Why is WordPress Asking For Your FTP Credentials to Install Plugins?

You want to install any plugin, but *blink* – WordPress need your FTP credentials. What the hell? The problem is simple – whenever you use WordPress to install, upgrade, or delete plugins, WordPress must make changes to files on the filesystem.

If WordPress does not have the necessary permissions to modify the filesystem directly, you will be asked for FTP credentials so that WordPress can try to do what it needs to via FTP.”

How to fix this problem? Open the wp-config.php file of your WordPress installation folder. Copy the below code and paste it at the wp-config.php file.

define('FS_METHOD','direct');

FS_METHOD works in some cases. WordPress tries to create a file ‘wp-content/temp-write-test-‘.time(). If this fails it assumes that you can only use FTP. But this might not be true if the wp-content folder itself is not writable, but for example, the folder wp-content/plugins is.

So the FS_METHOD method will probably work but the problem can be after unpacking the package. If the error says: “Could not create directory.”, you must set chmod 755 to the wp-content folder.

Total Commander: FilesĀ > ChangeĀ attributes > Set 755
Ubuntu: sudo chown -R www-data:www-data PATH_TO_WORDPRESS_FOLDER

Does it work for you? Write in the comments!

Recent Articles

How to find WooCommerce products in the database

Hey, where in the database (or phpMyAdmin) are my WooCommerce products stored? Sometimes you may have some reason to find directly any...

Why is WordPress Asking For Your FTP Credentials to Install Plugins?

You want to install any plugin, but *blink* - WordPress need your FTP credentials. What the hell? The problem is simple -...

Fix PHP Warning: POST Content-Length of 8978294 bytes exceeds the limit of 8388608 bytes in Unknown on line 0

This error is getting probably when you trying to upload an import on WordPress on your XAMPP local dev environment, right? Well,...

How to Hide Shipping Methods in WooCommerce?

This is a small detail, but WooCommerce doesn't have built-in any function for hiding shipping methods based on different situations. Imagine when...

How to Get WordPress Post Featured Image URL

Are you a WordPress developer or an advanced WordPress user? Whoever you are, sometimes you may need the direct URL of a...

Get in touch

Be our first-class reader, build a community and follow us on social media!

Leave A Reply

Please enter your comment!
Please enter your name here