3

Im using wp cli on my bedrock directory setup and have the files in the wp dir. now installing the core using

wp core install --url=xxx --title=xxx --admin_user=xxx --admin_email=xxx --admin_password=xxx

and gives

PHP Fatal error: Uncaught mysqli_sql_exception: Table 'xxx.wp_options' doesn't exist in

The target db is empty with no tables. Please suggest.

thevikas
  • 1,618
  • 1
  • 14
  • 31

1 Answers1

2

Found out the problem was I was using php8. The same wp cli command worked properly in php74

thevikas
  • 1,618
  • 1
  • 14
  • 31
  • I'm encountering this same error while using php 7.3.33, 7.4.25, and 8.0.13 I don't think it's php related. – Matt van Andel Dec 24 '21 at 19:42
  • For posterity: I read in all the wp-config.php values from a .env file. When I changed the table prefix from a custom one to 'wp_', the command started working. I deleted the database and changed the prefix back to my custom one, and it is still working. All I can think is that something in my .env file was being pulled in incorrectly or something was corrupted. `wp config get` looked fine, though. Hopefully this helps someone else. – Matt van Andel Dec 24 '21 at 20:26
  • Downgrading php from 8.2 to 7.4 actually did fix it for me. Thanks! – ACJ Jan 07 '22 at 15:18
  • Got the same error! And this is the correct fix! Thanks a lot for your help. – Anh Tran Jan 21 '22 at 08:40