I've a problem with my WordPress. When I'll upload a media file and W3 Total Cache gives a error with the filepermissions.
When I login with SSH and change the group from example user:user to apache:apache
sudo chown -R apache:apache wp-content
Everything is fine. W3 Total Cache gives no error and the media upload will work fine. But when I'll change with FTP a file, there is a error that I have no permission to edit the file. When I'll change it back to user:user the errors return in WordPress W3 Total Cache and I can't upload with media
This is with all users on my server. Is there a way to change this, so I have permissions in WordPress en with a external FTP program like Filezilla?
You could change it to user:apache permission. Set user group and apache user. It allow Apache to work with this files and allow your FTP client work with same files too.
You could use chrooted ftp using sftp. It's pretty logical to have such issues since the user and group for your ftp user are different than the user/group for the user under which the web server runs
Related
I recently had a PHP syntax error that crashed my server after using the plugin editor on my Wordpress website. It is an AWS Elastic Beanstalk hosted website, so I had to use PuTTY to change the file permissions and allow ec2-user to read/write durring SFTP via Filezilla.
I am not experienced with his sort of thing and followed the information from this question to accomplish this task.
Everything went well, but now I cannot edit or "write" anything via my Wordpress website. No plugin updating, no file editing, nothing. It says I need to change my permissions.
Due to my lack of knowledge on this, I have no idea how to reverse what I did when I entered
chown -R ec2-user /var/app
chmod -R 755 /var/app
How do I set the permissions back so I can edit files and update plugins via Wordpress admin?
EDIT: I found out that all I did was change ownership of the files to ec2-user. SO I guess my new question is how do I find out what username to use for my WordPress site to give it back ownership of the files?
Fixed:
I wound up adding
echo(exec("whoami"));die();
to the top of my WordPress index.php file to figure out the user. Make sure to remove it once you're done.
Lets say my username wound up being "foo".
After I had the username, I went back into PuTTY, and ran
sudo chown -R foo /var/app
and can now modify files through wordpress again.
I have a running wordpress website and the only issue I have is that each time I want to save an update it's asking me to enter my ftp password.
Is there a better solution to remove this popup without changing wp-content folder permission to 777?
I have run into this issue when the files on my web server are configured with the wrong owner or group.
From the WordPress codex:
Typically, all files should be owned by your user (ftp) account on your web server, and should be writable by that account. On shared hosts, files should never be owned by the webserver process itself (sometimes this is www, or apache, or nobody user).
https://codex.wordpress.org/Changing_File_Permissions
This is something that you will need to resolve on your web server if you know your user and group. Your username is likely the same as your FTP user.
chown -R user:group /path/to/wordpress
If you are on a shared hosting environment you will need to contact your host so that they can fix this problem.
You should also avoid using 777 permissions on your folders. Folders should be 755.
I recently migrated my Wordpress sites to Bitnami on Amazon Web Services. Everything it up and running from the user's perspective, but I'm struggling with a minor permission issue with the themes folder. When I download (or upload my own) theme, it doesn't have write permissions. Bitnami has this as the default for security purposes but when I had my stuff hosted at GoDaddy, this issue never came up.
The odd time I like to go and edit a theme file directly from Wordpress. I also have a File Manager plugin installed that I'll sometimes use instead of FTP to upload theme files.
I can manually change the permissions, either in FileZilla or using SSH but my curiosity and stubbornness would like to have write permission by default on any themes, new or existing.
Do I need to edit a config file somewhere to make this happen?
You need to connect to your server via SSH and execute the commands below described in order to assign correct permissions definitively:
sudo chmod -R g+w /opt/bitnami/apps/wordpress/htdocs/wp-content
sudo chown -R bitnami:daemon /opt/bitnami/apps/wordpress/htdocs/wp-content
Then check again if your themes works as you expected.
You can read our documentation to clarify all this situation: https://docs.bitnami.com/general/apps/wordpress/
Running Centos 6, apache, MySQL and vsftpd. I am trying to upload a plugin to WordPress via its web frontend. I made a user on centos and vsftpd that would coordinate, added them to the same group (apache:apache) and but when I try and upload it I get the unpacking the package, could not create directory error. I've change permissions from as the come to 777 (w/ -R) as well as checked that user groups are in sync. I've even gone and changed the user and group to make them the same as the login for the FTP. Here is the issue. If I login via a direct FTP client or over CLI, I don't have any issues and I checked that the users are the same, permissions, etc. I even added define('FS_METHOD','direct'); to give it a go. All to no avail. I'd really like your thoughts. Hosted here so full root access is not an issue.
Try the following - usually works:
# chown apache:apache {path_to_webroot} -R
# chmod 755 {path_to_webroot} -R
I'm trying to update Wordpress plug-ins, and I'm presented with the familiar FTP login screen.
I have read other posts indicating the lines in wp-config.php to be filled in. However, I don't have FTP installed on this server, just SFTP.
Also, I don't want to have to do this for each Wordpress install.
As far as I know, wp-content is already owned by apache:apache, and PHP is also running as user apache.
Is there something I'm missing? Is there some other way to handle this?
This has happened to me alot, when installing wordpress on my own server. Usually it has to do with a permission problem.
A lot webservers use the user www-data, instead of apache. So check your apache configuration for what your webserver user is set to.
Also you will want to check your directory permissions, and make sure both the user and group has read, write, and execute access. I am not sure if execute access is necessary, but that is usually what I set my server too.
You can do this with the command
chmod 775 -r your_wp_content_directory
And if all else fails, if you have shell access you can also use wget in the directory to install plugins.
After trying everything I could find regarding permissions, I added the following line of code to this site's wp-config.php:
define('FS_METHOD', 'direct');
That immediately solved the problem. Not sure if I also needed to modify the permissions first, since i did that before trying this fix.