How to Stop WordPress Asking for FTP details to Upgrade Plugins

There are a couple of ways to get rid of the FTP Connection Information form.

The first method will likely only work if you have your own dedicated or private server with root ssh access.

For 99.9% of shared hosting, you are unlikely to have the privileges required to muck around with the web server settings and that is what’s needed.  If this is you, jump to the quick fix.

For this first method, we’re going to find out which user owns the web server and give that user ownership of your WordPress installation.

We’re assuming you’ve got a Linux box running Apache as the web server as that’s the most popular hosting plan type.

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@ubuntu-box:/# ps aux | grep ‘apache’
root 1933 0.0 2.3 44900 12032 ? Ss Aug25 15:09 /usr/sbin/apache2 -k start
webuser 2572 0.0 6.2 66468 30246 ? S Mar10 0:04 /usr/sbin/apache2 -k start
webuser 6045 0.0 6.4 66884 31562 ? S Mar10 0:07 /usr/sbin/apache2 -k start
webuser 6786 0.0 5.6 64156 27632 ? S Mar10 0:10 /usr/sbin/apache2 -k start

This tells you that the web server is running under the user webuser.

You can now give that user recursive ownership (all subfolders) of your WordPress installation using the command:

chown -hR webuser:webuser /var/mydomain.com/public_html/wordpress/
sudo chown -R www-data:username /var/www

Replacing webuser with whatever user is running your Apache server and the last part with the direct path to your root WordPress installation folder.

Note: Some chown versions are different.  Type chown –help to get info on your version.

The Quick Fix

Ok, so you’re on a typical shared hosting plan and just want this damned FTP Connection Information form to go away.

Here’s what to do.

Edit your wp-config.php file (found in the root of the WordPress installation) and add the following lines somewhere in between the start :
[pre]/** Setup FTP Details **/
define(“FTP_HOST”, “localhost”);
define(“FTP_USER”, “your-ftp-username”);
define(“FTP_PASS”, “your-ftp-password”);[/pre]
Replacing the values with whatever you use on the FTP Connection Information form.

Once saved and uploaded if making the changed from a local copy, you should no longer be prompted for FTP Connection Information.

You may also like...