Have you ever got the message Connection Information and a form is prompting you to enter FTP information when doing updates, delete, install new themes or plugins?
I saw that message after move all my hosting files from default location to other place that allows my website running on VPS with lower permission to increase the security.
This problem is very easy to fix and stop WordPress Ask for FTP Credentials again but you will frustrating sometimes of trying to get it done if you don’t know the causing of this problem.

Stop & Fix WordPress Ask for FTP Credentials
Stop & Fix WordPress Ask for FTP Credentials

What is Causing of WordPress Asking for FTP details ?

When automatically upgrading, installing or updating a theme or plugin or the WordPress core, WordPress needs to make changes to the file system.

Before making any changes, WordPress first checks to see whether or not it has access to directly manipulate the file system.

If WordPress does not have the necessary permissions to modify the filesystem directly, you will be prompted to enter your FTP user account information.

And the causing of this problem is:

WordPress asks for your FTP credentials when it can’t access the files directly. This is usually caused by PHP running as the apache user (mod_php or CGI) rather than the user that owns your WordPress files.

What Can I Do To Stop and Fix WordPress Ask for FTP Credentials?

The easiest way to solve this problem is add the following FTP information to your wp-config.php

define('FS_METHOD', 'direct');
define('FTP_BASE', '/usr/home/username/public_html/my-site.example.com/wordpress/');
define('FTP_CONTENT_DIR', '/usr/home/username/public_html/my-site.example.com/wordpress/wp-content/');
define('FTP_PLUGIN_DIR ', '/usr/home/username/public_html/my-site.example.com/wordpress/wp-content/plugins/');
// define('FTP_PUBKEY', '/home/username/.ssh/id_rsa.pub');
// define('FTP_PRIKEY', '/home/username/.ssh/id_rsa');
define('FTP_USER', 'my-ftp-username');
define('FTP_PASS', 'my-ftp-password');
define('FTP_HOST', 'ftp.my-site.example.com');
// define('FTP_SSL', false);

Problem Solved?

  • No! WordPress still asking me again with that stupid message!
  • Just wait, I haven’t installed FTP service on my server!

Moving on. If you answer me like that, you had or need the permission to control your server.
For this first method, it’s fixing your problem on 99.9% of shared hosting.
For the second method which can fix your problem in any case, we’re going to find out which user owns the web server and give that user ownership of your WordPress installation.

Looking for web server ownership process

After test and research on Internet in many times, I realised it’s the owner of the PHP process, not the web server software processes like Apache, Nginx, …
So try running ps aux | grep php to see which user owns the PHP process. Here is my case:

$ ps aux | grep php
root      1249  0.0  0.1 290648  5956 ?        Ss   Sep17   0:01 php-fpm: master process (/etc/php/php-fpm.conf)              
http      1278  0.0  1.0 374340 39492 ?        S    Sep17   0:21 php-fpm: pool www                                            
http      1279  0.0  1.1 374808 41460 ?        S    Sep17   0:12 php-fpm: pool www                                            
http      3934  0.0  1.0 374852 38048 ?        S    Sep17   0:17 php-fpm: pool www

It tells me that the PHP process is running under the user http.
So, a quick solution will be to issue this command and give user recursive ownership of the whole WordPress installation

$ sudo chown -hR http:http PATH_TO_YOUR_WORDPRESS_FOLDER

Replacing http with whatever user is yours.
Notes: If you are using Ubuntu. The default user and group of your PHP and Web Server software is www-data.

I really hope that helps someone, I spent ages being confused over this “feature”! If you have any more details or information, or if this works for you, then please add a comment below

The post Stop & Fix WordPress Ask for FTP Credentials Upgrade and Install New themes, plugins appeared first on NARGA.

Other posts you may like:

  1. How to FIX WordPress Posts Missed Schedule Problem
  2. 10+ Essential WordPress Plugins to Backing Up your Database
  3. How to make your theme support Jetpack’s Infinite Scroll feature
No Comments
Comments to: Stop & Fix WordPress Ask for FTP Credentials Upgrade and Install New themes, plugins

Recent Articles

Good Reads

Gemstones have been a source of fascination for centuries due to their unique colors, properties, and potential to influence emotions and energy. In addition to their aesthetic value, gemstones have been highly regarded by many cultures for their alleged ability to attract positive energy and prosperity. This article​ will discuss the ⁤arrangement of different gemstones […]

Worlwide

Overview VipsPM – Project Management Suite is a Powerful web-based Application. VipsPM is a perfect tool to fulfill all your project management needs like managing Projects, Tasks, Defects, Incidents, Timesheets, Meetings, Appointments, Files, Documents, Users, Clients, Departments, ToDos, Project Planning, Holidays and Reports. It has simple yet efficient layout will make managing projects easier than […]
Gemstones have been a source of fascination for centuries due to their unique colors, properties, and potential to influence emotions and energy. In addition to their aesthetic value, gemstones have been highly regarded by many cultures for their alleged ability to attract positive energy and prosperity. This article​ will discuss the ⁤arrangement of different gemstones […]
Bathroom lighting may not be a top priority for many homeowners in Singapore, but it can greatly impact our‌ experience in the ⁤space. To achieve optimal ⁤bathroom lighting, there are several factors to consider and tips to keep in mind when⁢ discussing lighting ‌concepts with your interior design‍ firm in Singapore. Why is Bathroom Lighting […]

Trending

Turquoise Jewelry is one of the ancient healing stones used for personal adornment and astrological benefits. The rare greenish blue-colored pectolite is celebrated for its enchanting powers among many crystal lovers. It is a hydrated phosphate of copper and aluminum that ranks 5 to 6 on the Mohs hardness scale. It is deemed a protective […]