Stop WordPress asking for FTP details

  • 23 May 2016
  • ADM

 

Stop WordPress asking for FTP details - images/logos/wordpress.jpg

 

WordPress is a free and open-source content management system (CMS) based on PHP and MySQL.WordPress is the most popular blogging system in use on the Web.

Problem

When your web server is running with a system account that does not have ownership on your file (wordpress folder), Wordpress will ask for ftp credentials for any operations tochange any file:

  • install/update plugins;
  • install/update themes;
  • update Wordpress.

Solution

To fix this you have to follow these steps:

  • Login to your server box using ssh;
  • Find out what user is running the web server by typing:
ps aux | grep 'apache'
  • The command will return something similar to this:
[root@admfactory.com ~]# ps aux | grep 'apache'
apache 1457 0.0 4.8 472924 49440 ? S 10:57 /usr/sbin/httpd -DFORCEGROUND
apache 2395 0.0 4.8 473140 49592 ? S 10:58 /usr/sbin/httpd -DFORCEGROUND
apache 2432 0.0 4.8 473012 49124 ? S 11:01 /usr/sbin/httpd -DFORCEGROUND
apache 2463 0.0 4.7 472476 48808 ? S 11:31 /usr/sbin/httpd -DFORCEGROUND
  • This tells you that the web server is running under the user apache.
  • You can now give that user recursive ownership (all subfolders) of your WordPress installation using the command:
[root@admfactory.com ~]# chown -hR apache:apache /var/www/html/

Now we are ready to install/upgrade a plugin with a single click mouse.

 

References