Bedrock /web URL Launch

Hey everyone,

I’m having trouble with moving a bedrock project to the production server. I can’t get the site visible without pointing the domain to the main directory instead of the /web directory.

I can get site working by pointing it to the main dir and changing the URL to example.com/web but when I go with a correct setup I get an internal server error message.

I’m going to look into my Apache2 settings as-well but I figured I’d start here first.

Thanks!

Honestly this isn’t really much to go on to try and troubleshoot. If it helps, I’m most likely a configuration issue than a bug :smile:

If you want to post some of your server configs like Apache, wp, .env, etc, go ahead.

You tried to put php statements in your .htaccess file and we don’t allow
that. I moved your statements to the Apache config and did a graceful
restart. The page is trying to load now but you’re getting this error:

You’re right, no bug just a strict sys admin.

Turns out the host allow php statements in the .htaccess file so we moved them to the apache config file.

Will that even work with WordPress? We’re now getting a page but there’s an error.

PHP Fatal error:  require_once(): Failed opening required '/usr/local/ftp/sp2/html/vendor/autoload.php'(include_path='.:/opt/rh/php54/root/usr/share/pear:/opt/rh/php54/root/usr/share/php') in /usr/local/ftp/sp2/html/web/wp-config.php on line 7

If I find a solution I’ll share here. It may be good to document an environment like this and the fix.

Thanks.

I’m confused. We have PHP in what .htaccess file? That file isn’t included in Roots or Bedrock.

Can you show us what the .htaccess contained?

Other error:

vendor/autoload.php can’t be found. Most likely issue if you haven’t run composer install on that server?

edit: Oh I guess that was an error message? Hard to tell as it’s normal text in your post.

@swalkinshaw, system admin mentioned the PHP in the .htaccess file. The file I’m referring to is in /web.

Here’s the modified contents:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

The site is up and working now. Here’s the fix:

Environment:

  • Ver 14.12 Distrib 5.0.77, for redhat-linux-gnu
  • Apache/2.2.24
  • PHP v5.4.4
  • VPS that doesn’t allow .htaccess files so rewrite rules were added to httpd.conf
  • Default open_basedir was also modded per instrux below.

The errors were coming from the server config. The open_basedir needed to be changed to the bedrock base folder. The original / default path can be overwritten in the php.ini, vhost.conf or httpd.conf file. Depending on your environment.

Thanks for the help!

EDIT: @cfx, good idea. I’ve added more details above.

2 Likes

Please describe your environment so users/search can find this info more easily!