A client informed me that any time he tries to update a plugin, he gets an error:
To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.
I don't have FTPd setup on the server, but this seems like a basic permissions issue, right? I've never had to use FTP credentials to update any other WordPress installations.
Well, I did some reading and started messing with permissions and long story short, out of frustration, I eventually made everything writeable by everybody:
sudo chmod -R 777 src
But I'm still getting the same error. So it has to be some type of configuration issue, right?
I ran a few find . -exec grep
commands to determine if there is a hard-coded document root (like in Joomla), but I came up empty handed.
Or maybe it's something in the database? The site was originally on a shared host but was moved to a DigitalOcean VPS a month or so ago.
Fix File and Folder Permissions in WordPress Using FTPOnce connected go to the root folder of your WordPress site. After that select all folders in root directory and then right click to select 'File Permissions'. This will bring up the file permissions dialog box. Now you need to enter 755 in the numeric value field.
You can change WordPress file and directory permission either through cPanel, FTP, or SSH. Using either cPanel or FTP, navigate to the file in question, right-click, and set the permissions desired. If you are using SSH, you can use the chmod command to set the permissions.
I was able to force WordPress to use the filesystem instead of FTP by setting the FS_METHOD
constant in wp-config.php
:
define('FS_METHOD', 'direct');
More details can be found in the WordPress codex.
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