Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Failure to correctly find wp-content/plugins or themes #785
I cannot get wp-cli to find my plugin or theme directories the way I've structured wordpress files (relative to webserver root)
index.php: (copied from WordPress install with path modified to send it to the subdirectory)
wordpress/ -->> Wordpress install as downloaded, no edited files
wp-config.php: (relevant excerpt below)
Note: I added the first two lines in an attempt to work around this problem. My blog behaves well on both my production web host and my local test install (MAMP) without it.
In my database, the blog location settings point to example.com and WordPress location settings point to example.com/wordpress
Instead it outputs:
Jezza:public_html flutterby$ wp --info
Modify wp-config.php so that it looks like this:
And tell me what
Also, why do you use
wp plugin path now outputs:
(plugin path is unchanged)
Now my local (testing) MAMP webserver outputs:
I didn't have any reason I can identify to choose $_SERVER['DOCUMENT_ROOT'] instead of dirname(FILE). I just took the example from the WordPress Codex here: http://codex.wordpress.org/Editing_wp-config.php#Moving_wp-content_folder
This was referenced
Apr 2, 2015
referenced this issue
Apr 17, 2015
Just FYI, this is because PHP is a bit of an idiot.
You're not doing it wrong, PHP is doing it right and it's unexpected. WP-CLI doesn't fully populate the #_SERVER array because PHP can't via command line :( Not an answer, but hopefully an explanation that helps.