Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have a WP site running on Ubuntu 11.04. I set the apache www-data user to have write permissions on the entire wordpress directory recursively. This made it possible to update the plugins automatically, but the site upgrade functionality is prompting me for FTP credentials. How do I get that screen to work for updates without using FTP?

share|improve this question

3 Answers 3

Easiest way: Use mod_suphp instead of mod_php. This should just be a matter of using whatever ubuntu's package manager is to remove mod_php and install mod_suphp instead.

mod_suphp is a slightly modified version of mod_php. It does the same thing, but it sets the user of the apache process to be the same as the owner of the PHP files when the PHP executes. This gives PHP the proper permissions to be able to modify the PHP files owned by that user.

This is actually more secure on a shared hosting environment, because in case of a break in via the web, the intruder only gains the privs of the one user account and can't access files outside that user account (whereas with the apache user credentials, he has greater access to many hosting accounts).

Anyway, with mod_suphp or any setuid method for running php scripts, this will let WordPress recognize that it can create files with the proper ownership and thus it will use the direct mode for upgrading itself.

share|improve this answer

You can permanently store the FTP credentials in wp-config.php. Add the following to this file:

define('FTP_HOST', 'ftp.example.com');
define('FTP_USER', 'user');
define('FTP_PASS', 'password');
define('FTP_CONTENT_DIR', '/home/username/public_html/wp-content/');
define('FTP_PLUGIN_DIR ', '/home/username/public_html/wp-content/plugins/');

This will prevent WP from prompting you for the credentials, and will use the values stored in wp-config.php instead.

share|improve this answer
    
Can this also be done using scp? –  grm Aug 16 '11 at 9:59

If this is a local test site you could do this :

chown -R nobody:nobody /path/to/wordpress

If it's a live site it might be unsecure though.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.