In this post, we will look at how to fix "WordPress asks for FTP credentials" when updating, installing and deleting plugins or themes.
WordPress is the most popular content management system in the world. More than 34% of websites on the internet are developed using WordPress. The best thing about WordPress is that it is very easy and flexible for developing different types of websites. The main advantage of WordPress is that it combines all the required plugins in one place where it helps in developing and managing content.
Starting with WordPress version 3.X, the plugins are available in one place where you can easily update and install them. However, you need to be an administrator to update, install, or delete a plugin in your dashboard. Most installations require only a single click.
In some cases, you will see an additional form where you need to provide your FTP account details. This is the reason why WordPress admin dashboard often asks for an FTP login when updating, installing or deleting plugins. When you install or update plugins or themes from the WordPress dashboard, the file permission system on your hosted site may change. To get authorization and permission to make changes, WordPress asks you for your FTP login credentials.
The above statement can be understood to mean that when WordPress updates or installs a new plugin or theme on your behalf, it updates the data on the server on behalf of the "Apache" user. By default, the server does not allow "Apache" users to make changes on the server. This results in a permission error and requires an FTP login to authorize the action.
Frequently asking for FTP credentials would make you tiered in installing and updating the plugins in your WordPress site. So, the following is the process to resolve the Frequently asking for FTP credentials.
First, you need to find the wp-config.php file located in the root folder. The root folder can be accessed in two methods.
- Resolve to ask FTP credentials using cPanel
- Resolve using Putty Tool
Method 1: Resolve to WordPress ask FTP Credentials
Table of Contents
You can edit wp-config.php using cPanel and FTP. I use the FTP client software Filezilla to edit the wp-config.php file.
Edit wp-config.php file using cPanel
Step 1: Log in to your hosting account.
Step 2: Go to your cPanel.
Step 3: Select File Manager and go to the root folder.
Edit wp-config.php Files using FTP Client Software
If you don't have access to your cPanel, use the "FileZilla" software to connect. I recommend you use the same code.
Step 1: Use your FTP credentials to connect.
Step 2: Once the connection is successful. Now you can see the folders. Find the root folder to open the 'wp-config.php'.
Then just add the following lines in between the file.
define ("FTP_HOST", "localhost");
define ("FTP_USER", "your-ftp-username");
define ("FTP_PASS", "your-ftp-password");
Just replace the username and password of your in the last two lines. Now, just save from now you won’t receive any updates regarding the FTP login. Look at the process everything should be done in your localhost where you actually installed your WordPress software.
Method 2: Resolve using Putty or Web Console
Start your SSH terminal with the Putty tool or the web console and simply run the following line.
chmod 777 /yourwebsitename/public/wp-content/plugins/
The above line will give you full permission to the plugins available in the 'wp-content' folder. Just enter the name of your website in the 'yourwebsitename ' location. This step takes the place of asking for FTP credentials when installing and updating plugins and is especially useful for users who use Linux as their operating system.
Hope you have found the solution to the FTP credentials problem. You can try any method, it would bring you the solution. In my opinion, using cPanel it easier to solve the problem. If you use DigitalOcean, Vultr like services apply the second method.
Prabhu Ganesan provides his web development and WordPress services independently. He is the founder of WPBlogX. He is very much involved in WordPress as it becomes second nature for him. You can get in touch with him by visiting his website – WPBlogX.com and you can also find him on Twitter @gprabhucbe.