WordPress asking for my FTP credentials to install plugins

“Whenever you use the WordPress control panel to automatically install, upgrade, or delete plugins, WordPress must make changes to files on the filesystem.

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 asked for FTP credentials so that WordPress can try to do what it needs to via FTP.”

Solution: In order to find out what user your instance of apache is running as, create a test script with the following content:
<?php echo(exec(“whoami”)); ?>

For me, it was www-data. Then, fix the permission by:
chown -R daemon /path/to/your/local/www/folder

It should resolve the issue. If you are still facing the issue then check the directory and file permissions. Directory permissions should be 755 and file permissions should be 644.

If you are still facing the issue then add the below line in wp-config.php.
define(‘FS_METHOD’, ‘direct’);

admin

Our team has expertise across software and web development, WordPress, e-commerce, mobile applications, UI/UX, cloud and infrastructure, DevOps, CI/CD, API integration, security, testing, automation, and technical support. The team also works with AI-based software solutions, LLMs, AI workflows, AI agents, and intelligent application development to help businesses automate processes and build smarter digital solutions. We focus on developing, deploying, maintaining, and optimising secure, scalable, and reliable technology solutions while helping businesses adopt modern technologies and drive digital transformation.

Leave a Comment

Scroll to Top