Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't install plugin and theme

Tags:

iis

wordpress

ftp

i want to install some plugin but show

Installation failed: Could not create directory.

that i find some solution add some code to wp-config

//* FTP Settings **/
/** wp-content path */

define('FS_METHOD', 'ftpext');
define('FTP_BASE', '/');

define('FTP_CONTENT_DIR', '/wp-content/');
define('FTP_PLUGIN_DIR', '/wp-content/plugins/');
define('FTP_USER', 'ftpuser');
define('FTP_PASS', 'ftppewd');
define('FTP_HOST', 'domain.com');

define('FTP_SSL', false);

define("FS_METHOD", "direct");
define("FS_CHMOD_DIR", 0777);
define("FS_CHMOD_FILE", 0777);

that the error message change to

Installation failed: Unable to connect to the filesystem. Please confirm your credentials

. i use IIS 8 use ftp client the ftp account has full access right

like image 713
petercheung Avatar asked Aug 21 '16 13:08

petercheung


3 Answers

You might also want to check the ownership of the folder: try this

sudo chown -R www-data:www-data /var/www
like image 156
Gerard Pietrykiewicz Avatar answered Sep 23 '22 07:09

Gerard Pietrykiewicz


After a clean install of Wordpress locally, add below statement

define("FS_METHOD", "direct"); to my wp-config.php file.

Later change the ownership of the wp-content and the contents inside the wp-content folder to the web server user (_www) I used the below commands.

sudo chown _www:_www wp-content

sudo chown _www:_www wp-content/*

Alternatively you can also set the permission recursively using

sudo chown -R _www:_www wp-content/

like image 39
Vineel Avatar answered Sep 24 '22 07:09

Vineel


It complains about FTP credentials when it cannot access the filesystem.

Most likely your permissions are wrong (directory inaccessible by webserver)

If you ensure that your wordpress directory is owned by the same user who runs your webserver, the FTP credentials note should disappear and you should be able to install themes and plugins via Wordpress Admin console.

like image 37
dovka Avatar answered Sep 20 '22 07:09

dovka