Rename the web-directory?

I’m trying to get Bedrock running on a shared host (swedish host Now I know that it isn’t quite the target demographic for Bedrock but it seems like it should work with just a few modifications.

The most obvious limitation I have is that the website root is called public_html and that can’t be change. I have SSH-access and full access to the folder that houses public_html so I thought that a simple rename of web to public_html should fix it. It sort of worked but not quite. I’ve change web to public_html in the following files:

  • composer.json
  • wp-cli.yml

The most of the site loads but no themes are available and I get a few errors:

  • AH01071: Got error ‘PHP message: PHP Notice: Undefined index: host in /var/www/public_html/wp/wp-includes/http.php on line 359\nPHP message: PHP Notice: Undefined index: host in /var/www/public_html/wp/wp-includes/http.php on line 360\n’, referer:
  • AH01071: Got error ‘PHP message: PHP Warning: require(/var/www/web/wp/wp-admin/menu.php): failed to open stream: No such file or directory in /var/www/public_html/wp/wp-admin/admin.php on line 115\nPHP message: PHP Fatal error: require(): Failed opening required ‘/var/www/public_html/wp/wp-admin/menu.php’ (include_path=’.:/usr/share/php:/usr/share/pear’) in /var/www/public_html/wp/wp-admin/admin.php on line 115\n’, referer:
  • AH01071: Got error ‘PHP message: PHP Notice: Undefined index: host in /var/www/public_html/wp/wp-includes/theme.php on line 1944\nPHP message: PHP Notice: Undefined index: host in /var/www/public_html/wp/wp-includes/theme.php on line 2003\n’, referer:

Somehow there is some reference to the web-directory I haven’t found (since it tries to import wp-admin/menu.php from web) and I don’t really know where to look. Right now I’m guessing that the index: host error is related since I’ve configured the .env-file with the correct values.

  1. Is fairly easy to do what I am attempting (read should I bother continueing on this path)?
  2. What the crap am I doing wrong? Why is it still expecting the web-folder?
  3. Does someone have an alternate theory for the index: host issue?

Any help or pointers at all are much appreciated.

1 Like

I know other people have done it and it shouldn’t be too hard. But it seems like you’ve missed the most important part to update. You’ll need to update any reference to web/ in config/application.php:


That was it. Thank you very much.

I apparently had a massive black out. Despite reading the docs (and actually noticing the config-folder) I didn’t think of checking the files there. (Queue Homer “doh”)

Thank you yet again for helping me.

ahh seem to be having a similar issue, however i’ve changed -

But keep getting the white screen of death!. Can still access the admin panel.

I’ve done this previously on another site, and fixed the same issue… but can’t for the life of me remember how I did it!!

Any help would be greatly appreciated.

Without an actual error, it’s a guessing game. Turn on WP_DEBUG for a second and check what the error is.

set -
define('WP_DEBUG', true);
define( 'WP_DEBUG_DISPLAY', true );

And not any logs or errors.

Managed to get it working on my local with the new folder structure. Disabling and re-enabling the theme seemed to resolve the issue.