Thereās probably something āobviousā that Iām missing. Just starting out with roots .
I installed wp-cli globally and Iām able to run theme-folder$ wp --info
If I try to run wp --help get the following error:
theme-folder$ wp help
Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in /Users/me/examples.com/site/web/wp/wp-includes/wp-db.php on line 1488
Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /Users/me/roots/examples.com/site/web/wp/wp-includes/wp-db.php on line 1518
Warning: mysql_connect(): No such file or directory in /Users/me//examples.com/site/web/wp/wp-includes/wp-db.php on line 1518
Okay, thanks for your help! I followed the trellis steps in the doc and my wpdev site and vagrant environment are up and running. I probably missed a step.
I donāt know what your set up is. Which docs are you reading? Are you using Trellis? If so, you need to SSH into the vagrant box for any database commands to run, and thatās the vast majority of wp commands.
Otherwise, if you have it set up with MAMP or something like that, you would need your PHP and MySQL set up correctly.
Edit sorry saw you said ātrellisā in your second message. Yes, run vagrant ssh and cd /srv/www/{your-site.com}/current and run your wp-cli commands there.
You can run some, but most wp commands basically load WP, and because they do, they will look at the database credentials and try to connect. At the moment, we canāt connect to the database remotely with the database credentials, so we canāt run quite a few wp commands from the host. Itās been that way since the beginning, and almost all WP projects that use Vagrant.