Thursday, November 9, 2017

Wordpress | localhost | plugin | ftp | error install

if:

"To perform the requested action, WordPress needs to access your web
server. Please enter your FTP credentials to proceed. If you do not
remember your credentials, you should contact your web host."



When: wordpress install plugin on localhost (development)





then:

chown -Rf www-data.www-data /var/www/html/yourdirectory






why i can't install a new plugin on my wordpress? | DigitalOcean





or:



Add this to your wp-config.php



 
define('FS_METHOD','direct');


Due to linux having such a more restrictive file system, this will enable to you write directly to the folder.


THIS SOLUTION WORKED FOR ME:

1. Web Server Ownership
The first level is actually to make sure that your web server has ownership over the directories:

chown -R www-data:www-data your-wordpress-directory


2. Directory Permissions
The second level is also required – you must make sure that the directory permissions are properly set:

sudo find /var/www/wordpress/ -type d -exec chmod 755 {} \;
sudo find /var/www/wordpress/ -type f -exec chmod 644 {} \;


I’ve found that most solutions posted on the web show part two but skip the first part.

Source:  https://wpnow.io/how-to-solve-wordpress-could-not-create-directory/

No comments: