I just used Local to spin up a new site and followed the Bedrock + Local installation instructions. The new folder structure I get, however, doesn’t match what the instructions describe: the /app directory is missing the /sql directory.
Any ideas why this is and how I can fix it? I’ve been working for hours, trying to install Sage by itself, and encountering errors connecting to the database. I tried Bedrock, thinking maybe the database issue would be resolved there, but I’m betting the absence of that /sql directory spells ongoing trouble.
I just followed the guide for Bedrock and Local on a fresh install of macOS and everything is working fine for me
It looks like that folder used to be there and it no longer is, but the docs were just showing it for the purpose of helping show the directory structure. Bedrock doesn’t actually require any changes or anything to do with that directory for Local support — you just need to update the web root. It looks like that folder shows up at some point, but it isn’t there right away during a new install.
What errors?
If you copied .env.example to .env and followed the docs, things should hopefully be working. My full .env looks like:
DB_NAME='local'
DB_USER='root'
DB_PASSWORD='root'
# Optionally, you can use a data source name (DSN)
# When using a DSN, you can remove the DB_NAME, DB_USER, DB_PASSWORD, and DB_HOST variables
# DATABASE_URL='mysql://database_user:database_password@database_host:database_port/database_name'
# Optional database variables
# DB_HOST='localhost'
# DB_PREFIX='wp_'
WP_ENV='development'
WP_HOME='http://bedrock.local'
WP_SITEURL="${WP_HOME}/wp"
# Specify optional debug.log path
# WP_DEBUG_LOG='/path/to/debug.log'
# Generate your keys here: https://roots.io/salts.html
AUTH_KEY='generateme'
SECURE_AUTH_KEY='generateme'
LOGGED_IN_KEY='generateme'
NONCE_KEY='generateme'
AUTH_SALT='generateme'
SECURE_AUTH_SALT='generateme'
LOGGED_IN_SALT='generateme'
NONCE_SALT='generateme'
Thanks very much, @ben! I’ll have another go at it today. I’m sure it’s user error, but maybe I can find what I did wrong, and your advice will be super helpful.
Here’s the command and resulting error: wp acorn acorn:install Error: Error establishing a database connection.
For the Sage-only install, I definitely hadn’t set up my .env properly (is there a .env?) So that may be the issue right there. Thought I followed the instructions to the letter, but I guess not. I’ll try it Sage-only first, then with Bedrock + Sage, see if I can make it happen this time. Thanks again!
server {
listen 127.0.0.1:{{port}};
listen [::1]:{{port}};
root "/Users/bwalden/Local Sites/wordpress/bedrock/app/bedrock/web";
I have Laravel Herd installed—for the Statamic sites I build and maintain—but I’ve quit out of it, so I’m not sure how to move forward from here. Seems like such a straightforward installation process.
Sorry, @ben. Are you saying that, using localhost mode, I can’t set WP_HOME to “http://bedrock.local”? Idiot that I am—would you be able to spell it out for me, please? I’m afraid I’ll spend all day guessing and never land on the correct answer. Thanks!
Just did a complete from-scratch reinstall of LocalWP site and Bedrock. LocalWP says my Site Host is “localhost:10004” so I set WP_HOME to “localhost:10004” …
Did this, too:
server {
listen localhost:10004;
# listen [::1]:{{port}};
root "/Users/bwalden/Local Sites/wordpress/bedrock/app/bedrock/web";
Still will not connect. I understand it’s nothing to do with Bedrock—I’m missing a simple setting. What am I missing?
I’m using the Arc browser. That’s the problem. For whatever reason, it’s not honoring the port number on localhost, automatically changing http://localhost:10004 to http://localhost. Even stranger, Arc does this in one of my spaces, but not the other.
Lost a whole lot of time to a browser bug. Hope this saves somebody else a few hours!