How to configure site for automatic upgrades

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.

Leave a Comment