I don't have too much experiences with servers but I've tried to do something ;) I have my WP webpage on amazon EC2 and I wanted to edit some settings in php.ini through filezilla (sftp) But I had to set permissions to my user:
sudo chown -R ec2-user:ec2-user /etc
But now I can't even restart apache or set back permissions to root If i try to do something like this:
sudo chown -R root:root /etc
or
sudo systemctl restart apache2.service
I see this information: "sudo: /etc/sudo.conf is owned by uid 500, should be 0 sudo: /etc/sudoers is owned by uid 500, should be 0 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin"
What can I do?
It is located at /opt/bitnami/php/etc/php. ini. For example, to modify the default upload limit for PHP, update the PHP configuration file following these instructions.
To edit an instance's configurationStop the instance, if it is not already stopped. On the Instances page, click an instance name to display the Details page. Click Edit to display the edit page. Edit the instance's configuration, as appropriate.
Changing the instance type of your EC2 Linux instance allows you to change the following: Number of CPU cores. Amount of RAM. Amount of assigned instance store space.
You should never do sudo chown -R ec2-user:ec2-user /etc
. You have modified the permission settings of your entire /etc
directory.
/etc
is a very important folder for your operating system that's why you're getting the error.
launch a new instance and backup your source code from your previous instance and re-upload the code. let me know if you have any issues.
I'm not understanding why you can't modify your php.ini
file? You need to ssh into the server and edit the file. If you can't do that, you need to move the file to the ftp folder where it's permissible, modify the file and put the file back to it's original location and restart apache
.
Furthermore, I recommend you use Ubuntu
for your Wordpress server rather than using Centos
or Amazon
Flavour of Linux.
log into putty as ec2-user
sudo su
[root@ip-yoursite- home]
now for php 5.0 sudo vim /etc/php.ini
for php 7.0 use sudo vim /etc/php-7.0.ini
press i and now search for upload_max_filesize =100M , post_max_size=100M (change as per your requirement)
press esc ,now save and exit use this command:wq
restart your apache server
sudo service httpd restart
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With