0

Normally wordpress will auto-update fine without a fuss, but now throws the old ftp credentials form up in my grill.

I haven't changed any permissions in between updates, even running chmod and chown recursively to be sure, but still wordpress wants the ftp.

Out of the few wordpress installations i run, this is the only one playing hard-to-update.

I'll resort to a manual update if i have to and hope it fixes itself, but it'd be great to know what's the beef.

2
  • it's usually about chown actually. what user and group are you using with chown? ngnix or apache? what's the user who runs nginx or apache?
    – Jesse
    Apr 25, 2013 at 10:44
  • default www-data for apache, both owner and group from the parent dir down.
    – xVagabondx
    Apr 26, 2013 at 0:02

1 Answer 1

0

If you're pretty sure about that the file owner of wordpress folder is as same as that one who runs apache. (use ps aux|grep 'httpd' or ps aux|grep 'apache')

Here is a lousy solution for you:

function force_use_direct_fs($method,$args){
         if($method != 'direct')
              $method = 'direct';
         return $method;
}

add_filter('filesystem_method','force_use_direct_fs',10,2);

Why Would Wordpress Request FTP Credentials

wp-admin/includes/file.php

In function get_filesystem_method Wordpress will determine the proper filesystem method by comparing the file owner of a temporary file to the user who runs the web server.

Here is the code:

if( getmyuid() == @fileowner($temp_file_name) )
       $method = 'direct';

That's why I still think the cause is the wrong file owner permission.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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