Saturday, April 27, 2024
spot_img

Issues with automatic updates on localhost WordPress

The Issue: No WordPress updates on localhost

If you’re using a tool like MAMP or XAMP (etc.) to locally host development WordPress sites, you may have noticed you can’t run regular updates on the WordPress core, and can’t install plug-ins and themes from the repository. Quite likely WordPress is prompting you for FTP credentials, and it might also give an error related to not being able to create a directory, etc.

There are two issues. When is the FTP issue, the other is the permission issues.

Solution

FTP error

Wordpress connection information

If, whilst attempting to update your localhost WordPress, you get a message requesting FTP credentials (like the one above), you need to add the following to your wp-config.php file.

define('FS_METHOD', 'direct');

Just put it somewhere near the top of the file.

Permissions error

Wordpress permissions error

If the WordPress install/update system looks like it’s working but then reports some that it can’t create a folder, or something to that effect (see the above image), your system likely has a permissions error.

On Mac OS X it’s normally the case that Apache runs under the username _www . But MAMP (etc.) leave typically have your username (if that’s the one you used to run it) as the owner of the files. You’ll need to change the user to _www . Use these commands at the command line (in Terminal.app or iTerm, or what ever command line interface you like to use).

cd /parent/dir/of-your/wp-dir
sudo chown -R _www wp-dir
sudo chmod -R g+w wp-dir

So, you need to change directory to the parent folder of your WordPress installation. You are then changing the owner and permissions on the WordPress installation folder (I’ve used wp-dir  in my example, and you’ll need to replace that with your WP installation folder name).

Under normal circumstances, you should now be able to run updates and installs on your local WordPress instance.

Wordpress permissions error

Recent Articles

spot_img

Related Stories

Leave A Reply

Please enter your comment!
Please enter your name here

Stay on op - Ge the daily news in your inbox