Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress fails to install plugins: Unable to locate WordPress Plugin directory

Tags:

wordpress

I am unable to install plugins on my Centos 6 VPS. When I attempt the install I get this:

Installing Plugin: BotDetect WordPress CAPTCHA 3.0.Beta1.7

Downloading install package from
[web path to:]botdetect-wp-captcha.zip…
Unpacking the package…
Could not create directory.
Return to Plugin Installer

UPDATE: This seems to have something to do with permissions -- I'm guessing there's some group that wordpress needs to be part of in order to change folders, create files, etc., but I can't figure out what that group should be. I have no www-data group -- I read something somewhere about this being a requirement. Can somebody tell me what groups and permissions need to exist for WP to operate?

UPDATE: I have chmodded the permissions to my plugin and uploads folders to 777. I also have created an FTP user specifically for Wordpress and made the home directory for that user the same as my Wordpress root folder as recommended HERE. I then changed these lines in the wp-config.php file from:

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__ . "/"));

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

to:

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
    define('ABSPATH', dirname(__FILE__));

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . '/wp-settings.php');

This should eliminate the double slash conflict mentioned HERE.

Note -- I was also having a problem uploading media but that issues was resolved with the chmod to 777.

Now when I try to install a plugin I get this:

Unable to locate WordPress Plugin directory.<br>
Return to Plugin Installer

UPDATE: Per suggestions I have run chown -R on my wordpress directory and reverted my wp-config.php file back to this:

/** Absolute path to the WordPress directory. */
if ( !defined('ABSPATH') )
        define('ABSPATH', dirname(__FILE__) . "/");

/** Sets up WordPress vars and included files. */
require_once(ABSPATH . 'wp-settings.php');

My permissions look like this. I still have the problem.

[root@ip-MY_IP/wordpress]# ls -l
total 180
-rw-r--r--  1 apache apache   418 Dec 16 07:07 index.php
-rw-r--r--  1 apache apache 19929 Dec 16 07:07 license.txt
-rw-r--r--  1 apache apache  7183 Dec 16 07:07 readme.html
drwxr-xr-x  2 apache apache  4096 Dec 17 14:57 tmp
-rw-r--r--  1 apache apache  4892 Dec 16 07:07 wp-activate.php
drwxr-xr-x  9 apache apache  4096 Dec 16 07:07 wp-admin
-rw-r--r--  1 apache apache   271 Dec 16 07:07 wp-blog-header.php
-rw-r--r--  1 apache apache  4795 Dec 16 07:07 wp-comments-post.php
-rw-r--r--  1 apache apache  3087 Dec 16 07:07 wp-config-sample.php
-rw-r--r--  1 apache apache  3124 Dec 19 06:10 wp-config.php
drwxr-xr-x  6 apache apache  4096 Dec 18 21:03 wp-content
-rw-r--r--  1 apache apache  2932 Dec 16 07:07 wp-cron.php
drwxr-xr-x 12 apache apache  4096 Dec 16 07:07 wp-includes
-rw-r--r--  1 apache apache  2380 Dec 16 07:07 wp-links-opml.php
-rw-r--r--  1 apache apache  2359 Dec 16 07:07 wp-load.php
-rw-r--r--  1 apache apache 31909 Dec 16 07:07 wp-login.php
-rw-r--r--  1 apache apache  8235 Dec 16 07:07 wp-mail.php
-rw-r--r--  1 apache apache 10880 Dec 16 07:07 wp-settings.php
-rw-r--r--  1 apache apache 25665 Dec 16 07:07 wp-signup.php
-rw-r--r--  1 apache apache  4026 Dec 16 07:07 wp-trackback.php
-rw-r--r--  1 apache apache  3015 Dec 16 07:07 xmlrpc.php
like image 625
user1780242 Avatar asked Nov 30 '22 02:11

user1780242


1 Answers

The issue you're having is with ownership of the files. The folder is owned by a different user than the webserver therefore WP can't create a directory for the plugin you're attempting to download.

The changes you have made to wp-config.php need to be reversed.

Then SSH into your server and run:

sudo chown -R apache:apache /path/to/wordpress/dir

Replace apache:apache with a different user:group if your configuration is different.

like image 178
Nathan Dawson Avatar answered Dec 23 '22 20:12

Nathan Dawson