Search code examples
phpwordpressapacheftp

WordPress Plugin update asking for FTP


I moved a WordPress site to our VPS. In admin I am asked to update plugins, if I do that I am prompted for FTP info. As we don't run FTP on the server this is not possible.

I then changed the the permissions of all of the files to apache:apache using:

chown -R apache:apache *

This fixed the issue and WordPress can now update the files, however, now I cannot edit the files using filezilla. I also tried changing ownership to:

chown -R myuser:apache * 

So that I can edit the files but give apache group access. Now I can edit the files with filezilla but no longer update items in WordPress.

So, what is the correct way to go about this giving me write access on file level but still giving WordPress access to update the files?


Solution

  • Seems file permission issue.

    cd wordpress
    sudo find . -type d -exec chmod 0755 {} \;
    sudo find . -type f -exec chmod 0644 {} \;
    

    and following

    define( 'FS_METHOD', 'direct' );
    

    in wp-config.php

    or

    sudo chown -R www-data:www-data wordpress