Php error when app/themes or app/plugins directories are not empty

Hello all,

I’m quite new to all of this, but for whatever reason feel a strong pull toward Bedrock. I’m in a little over my head getting all this up and running with Vagrant and so I have three questions:

Question 1: How does one complete Step 5 of roots/bedrock install instructions which specifies:

Set your Nginx or Apache vhost to /path/to/site/web/ (/path/to/site/current/web/ if using Capistrano)

I can see in this thread that Scott says to do the above step 5, but my problem is that I simply don’t know how to set vhosts in Vagrant.

This may be irrelevant, but I’m using the hostsupdated plugin and can see that it is successfully adding lines to my machine’s hosts file.

Question 2: I see that my .env file after running vagrant up has become an alias (or symlink, right?)

.env -> /srv/www/example.dev/shared/.env

First off, is this supposed to happen? Secondly, I don’t see this dir anywhere within my bedrock-ansible or example.dev dir’s. Is this something I can access? If so, how?

Question 3: This is the primary reason I’m posting. When I log in as admin (with the credentials specified in .env and group_vars/all) the install appears to be okay, except that http://example.dev/wp/wp-admin/themes.php and http://example.dev/wp/wp-admin/plugins.php show a php error if the corresponding example.dev/web/app/ directories (/themes and /plugins) are not empty. In other words, I get no error if those dir are not being used, but once I place a theme or plugin into those directories, I get the corresponding error at the top of the page:

Themes error:

Warning: An unexpected error occurred. Something may be wrong
with WordPress.org or this server’s configuration. If you continue to
have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /srv/www/example.dev/current/web/wp/wp-includes/update.php on line 435

Plugins error:

Warning:  An unexpected error occurred. Something may be wrong
with WordPress.org or this server’s configuration. If you continue to
have problems, please try the support forums. (WordPress could not establish a secure connection to WordPress.org. Please contact your server administrator.) in /srv/www/example.dev/current/web/wp/wp-includes/update.php on line 287

So, what does all of this mean and does it have anything to do with Question 1?

Thanks in advance for any help you all can offer.

  1. Considering your site is installed and working, this is irrelevant. Especially because it seems you’re using bedrock-ansible? It takes care of everything for you. The README for Bedrock talks about a manual install process. It should be updated to referenced bedrock-ansible at some point.

  2. Symlink, yes. And yes it’s supposed to happen. You can access that file by running vagrant ssh. It exists solely on the VM.

  3. These are known errors. Once you add a theme or plugin, WordPress then checks for updates for them. The update requests take too long to complete for some reason through Vagrant and they time out causing those errors. Nothing is technically broken beyond it being slower and annoying. See this thread for more details: Suppressing no connection to wordpress.org error message

Thanks for the help, Scott. And thanks for the tip about how to get inside the VM with vagrant ssh. That’s the secret key I was looking for.

If I may ask, is there any general direction / helpful resources you could point me to regarding taking my first steps to learn about Nginx/Apache?

About the errors, thanks for the link. I had missed that thread since it was in Swedish :wink: I’m likely looking forward to the update as much as you guys are.

Most of all, I’m glad to have the confirmation that things appear to be working. Thanks for the help and thanks for all of your dedication to making Roots/Bedrock awesome.

I don’t know of “the best” sources to learn about web server configuration, but generally you want two things:

  1. Official documentation
  2. Tutorials - try searching for things like WordPress Nginx or WordPress Apache

It’s really just finding out how the configurations work and then reading up what the config settings do.

Ha. Thanks again.

Reminds me of this: LMGTFY

Just a note that I’ve committed a fix for the #3 problem: https://github.com/roots/bedrock-ansible/commit/38c32986ebe2c73df02ab86688f43c12c6bab431

1 Like

Very cool. Thanks so much, Scott!