Automatic update fails because of uid mismatch
-
I have WordPress 3.0.1 installed on a VPS server.
All directories are owned by my user, “andrea”, and the appropriate directories have write access to the group “www-data”.I checked out https://codex.www.ads-software.com/Changing_File_Permissions and I believe my permissions are as suggested there.
What happens is that I go to the plugins page click on “upgrade automatically” and I get the page to enter the FTP credentials instead of the automated process to proceed.
After a lot of digging I reached the file “includes/file.php” from line 839:
$temp_file_name = $context . 'temp-write-test-' . time(); $temp_handle = @fopen($temp_file_name, 'w'); if ( $temp_handle ) { if ( getmyuid() == @fileowner($temp_file_name) ) $method = 'direct'; @fclose($temp_handle); @unlink($temp_file_name); }
The first issue is with the temp_handle, the documentation that I linked above recommends that wp-content is not writeable, but if I do so, that first check fails.
Once I allow www-data to write in that directory the temporary file is created appropriately, but something strange happens, getmyuid() returns the uid of the Web server, but the fileowner is actually my username (andrea), hence the check fails and the method returned is ‘ftp’.
How can I solve this? Is it some VPS peculiarity or what?
The VPS is running Ubuntu 10.04, Apache 2.2.14 and PHP 5.3.2.Thank you
- The topic ‘Automatic update fails because of uid mismatch’ is closed to new replies.