wecodemore / wpstarter

Easily bootstrap whole site Composer packages for WordPress.
https://wecodemore.github.io/wpstarter/
MIT License
246 stars 35 forks source link

WP CLI couldn't read DB table prefix #61

Closed GaryJones closed 7 years ago

GaryJones commented 7 years ago

For a new site, I cloned the client's Bitbucket repo that had the initial files for WPStarter, and got the site up and running. All fine.

When I tried WP CLI though, I kept coming across errors like this:

wp-cli

@schlessera's conclusion was that the DB prefix was not recognised when WP-CLI parsed the config. My .env (edited with nano on the server, but I can't spot any line-ending issues when opening on my Mac) contained:

DB_TABLE_PREFIX=wpcwr_

Changing it to:

DB_TABLE_PREFIX=wpcwr_

didn't help.

Alain's solution was to hard code the prefix in wp-config.php:

screenshot 2017-02-21 01 15 50

And this worked - WP CLI could run as per normal with no errors.

So, why couldn't the.env table prefix be recognised before it got to this part of wp-config.php?

gmazzap commented 7 years ago

Merged and released in v2.4.2 https://github.com/wecodemore/wpstarter/releases/tag/2.4.2