I changed the webroot of my local site because i use bedrock with local. There’s a post here in this community explaining how to bring bedrock into local.
So i changed the document root: it’s not longer app/public but app/bedrock/web. With that change the open site shell script is not working correctly anymore: it always tries to change directory into app/public. when i now modify the script behind the open site shell script, it doesn’t work, because it seems, the script is always generated anew, when the button is clicked.
Hi @sambrockway ,
thanks for your hint. I checked the other steps sketched in the thread, but it didn’t change the broken open site shell button.
Thanks in advance for your help,
Matthias
Another thing, that breaks with this non-standard webroot is the configuration of the ssl certificates in the php.ini. That breaks the ability to make https requests from any wordpress plugin or theme. The template php.ini.hbs has this line
openssl.cafile="{{wpCaBundlePath}}"
Which expands to a path including the webroot, but it doesn’t get updated by the configuration change in site.conf.hbs. I can hardcode that, too. But perhaps… is it somehow possible to define the config vars used in the .hbs template files? Such that the templates stay the same and i configure {{root}} and {{wpCabundlePath}} somewhere?
Hey @snr - thanks for the bump. I work on our Local engineering team and was chatting about this with Nick and a couple of our engineers this morning.
What you’re describing is “expected” in the sense that Local doesn’t support Bedrock out of the box. That doesn’t mean it isn’t possible to get there, but as you said, the users who have figured it out are using some hacky workarounds.
Shell Script
You’re correct, that script is auto-generated each time the “Open Site Shell” button is clicked. The best option here is to edit the script as you have done, create an alias for running the script that you can call from a plain terminal, and then don’t click that button again. Clicking it would result in overwriting the changes.
SSL
You’ll want to restart your site for any changes to the .hbs files to be registered; this will regenerate the site with the changes.
An option for getting it working would be to provide the full path to the certificates that ship with WordPress - this would be the full path to /wp-includes/certificates/ca-bundle.crt.
For a more complete “better Bedrock support for Local” discussion, I created a feature request on the community forums - Support Bedrock in Local. This will allow others to upvote and jump in on ways we can improve this workflow.
Hey @snr - thank you for your comment about changing webroot. That has fixed my setup with a non-standard multisite
@austinwendt Having support for setting site root would be very helpful. My site is in a subdirectory of public, so I need to append --url=“https://site.local/subdir” to every WP CLI command.