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:
@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:
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?
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:
@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:Changing it to:
didn't help.
Alain's solution was to hard code the prefix in
wp-config.php
: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 ofwp-config.php
?