Joe's Quest

WordPress auto upgrade in Mac local environment

When I test WordPress in local Mac OS X, the auto upgrade function is not available. It shows up like below:

Connection info needed

Here describes reasons and solution. But it doesn't work in my situation: Using XAMPP to set up the testing environment. Another solution were provided in comment 44 by Johan L. It works alright!

Do as follows:


To set up file ownership correctly:
In WP root directory
chown -R yourusername:apachegroupname *
In my case…
chown -R johan:apache *

find . -type d -exec chmod 770 {} ';'
find . -type f -exec chmod 660 {} ';'

WP 2.8: add
define('FS_METHOD', 'direct');
define('WP_TEMP_DIR', ABSPATH.'wp-content/tmp');
in wp-config.php
The function in file.php reads FS_METHOD and the tmp file creation test is never executed.
Make sure the wp-content/tmp directory exists and is writable by the apache user

Pre WP 2.8: well… you may need to patch the function in file.php by removing the if statement before $method='direct';
see comment #38 above
Only do this if you're sure you've setup file ownership correctly.

BTW the three numbers in chmod describe rights for "user", "group" and "others". read==4, write==2, execute==1. Sum of rights make up the number. Hence 777 means read, write and execute for user, group and others. 660 means read and write for user and group, no rights for others.

NEVER do a chmod 777 on any file or directory. NEVER recommend anyone to do it either!

Note that it's better to upgrade to 2.8 and above first.

The key is the two lines in wp-config.php.

Thanks Johan L.

Discussion (1)

There is one response to “WordPress auto upgrade in Mac local environment”.

  1. I am very glad to see that you are putting so much of effort for encouraging the visitors with valueable posts like this, I have sent this post to my facebook profile.

Leave a Comment

Your email address will not be published. Required fields are bold.