krasniy
By:
krasniy

Install/update plugins VESTACP Wordpress

February 9, 2016 2.4k views
WordPress

I have Ubuntu and VESTACP running on my droplet. And Wordpress.

However, when installing or updating plugins, i get the following error:
**To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Followed by a form to input FTP credentials.

How can i resolve this issue?

Thanks

3 comments
  • Hi,

    First login as root:
    su

    Then so we dont have to write sudo all the time:
    sudo su

    Then we look at running processes by all users and look for php:
    ps aux | grep 'php'

    Now you should see in the first column somehting like www-data or whatever.
    This is what PHP is running as and you have to change owner of your wordpress folders and files recursivly (in all depths).

    We then enter the folder outside your wordpress directory, maybe it's something like:
    cd /var/www

    When you are in the correct dir, you can do:
    ls -la
    ...to see who owns your wordpress root directory.
    On my nginx install it said nobody owned html directory.... But as wordpress will get the owner of the PID of PHP (who PHP is running as), you have to change owner.. (it's not enough to grant a group with write and execute).

    So let's say you found out PHP runs as www-data, then you do:
    chown -R www-data ./yoursubdir

    I didnt have to restart my PHP but if it doesent work by simply refreshing wordpress admin, you can try to restart PHP. How you restart differs slightly depending on which PHP you are running, as the service will have slightly different name..

  • and my wordpress install is in /home/admin/web/MYIP/public_html

1 Answer

This question was answered by @olavamjelde:

Hi,

First login as root:
su

Then so we dont have to write sudo all the time:
sudo su

Then we look at running processes by all users and look for php:
ps aux | grep 'php'

Now you should see in the first column somehting like www-data or whatever.
This is what PHP is running as and you have to change owner of your wordpress folders and files recursivly (in all depths).

We then enter the folder outside your wordpress directory, maybe it's something like:
cd /var/www

When you are in the correct dir, you can do:
ls -la
...to see who owns your wordpress root directory.
On my nginx install it said nobody owned html directory.... But as wordpress will get the owner of the PID of PHP (who PHP is running as), you have to change owner.. (it's not enough to grant a group with write and execute).

So let's say you found out PHP runs as www-data, then you do:
chown -R www-data ./yoursubdir

I didnt have to restart my PHP but if it doesent work by simply refreshing wordpress admin, you can try to restart PHP. How you restart differs slightly depending on which PHP you are running, as the service will have slightly different name..

View the original comment

Have another answer? Share your knowledge.