White screen on shared hosting & urls duplicating

Hello, I’m on a shared web hosting environment unfortunately with none of the normal means of deploying a bedrock site. I do however have ssh and sftp access and am able to access above the web root (public_html) to place the files where things need to be.

A little background on the server: There are a few word press installs in both the root and various subdomains. I have created a subfolder for my Bedrock install and uploaded the files.

the folder structure looks something like this:

~/
├── bedrock # Config folder with .env and the rest of the files that are not within the web folder. This is outside of the public_html folder and only accessible by the server.
└── public_html # public_html is the web folder that contains the fore mentioned regular word press site.
  └─ subdomain # subdomain folder. Contains the contents of the web folder.

Above the web root in my bedrock folder I have uploaded the .env file & config and vendor folders:

bedrock
├── .env
├── wp-cli.yml
├── config
└── vendor

In my .env file:

WP_HOME=http://subdomain.mydomain.com
WP_SITEURL=${WP_HOME}/wp

In my config/application.php:

$webroot_dir = $root_dir . '/public_html/subdomainfolder';

and finally

wp-cli.yml

path: /wp

also my composer.json file.

"extra": {

 "installer-paths": {

 "~/public_html/isparx/subdomain/mu-plugins/{$name}/": ["type:wordpress-muplugin"],

 "~/public_html/subdomain/app/plugins/{$name}/": ["type:wordpress-plugin"],

 "~/public_html/subdomain/app/themes/{$name}/": ["type:wordpress-theme"]

 },

 "wordpress-install-dir": "~/public_html/subdomain/wp"

 },

Now in my subdomain folder aka the folder that holds the contents of what is normally the web folder I have edited

In my wp-config.php:

$bedrock = realpath(dirname(__DIR__) . '/../bedrock');
require_once($bedrock . '/vendor/autoload.php');
require_once($bedrock . '/config/application.php');

The site loading the index and it is loading the .env file/database etc…

However the page loaded is blank white and throws a notice of hosts is undefined on line /wp/ /wp/wp-includes/canonical.php 461

My understanding would be that an improper wp_home reference or link would cause this. I believed I put in all the correct patches, at this point I am a little lost on what else needs to be reconfigured to get the site up in working order?

Edit: Fixed the issue notice issue by running composer update, however white screen issue persists. No thrown errors. Tried disabling both plugins and themes. Still no luck. I also tried nuking the database and starting from scratch just to see if the migration of the database was the issue but the issue persists.

Edit: I can get other urls than index to resolve, such as sub.domain.com/wp/wp-login however the result is https://sub.domain.com/sub.domain.com/wp/wp-login.php something is gravely wrong.

Any ideas and suggestions are more than welcome.

Does this help?

This post was actually what I used as a model for setting up as well as @Foxaii posts in the original thread as well.

I know you’ve said no errors thrown, but it’s worth checking the actual error log as these wouldn’t show in the browser on a production environment.

From what you’ve described your bedrock and public_html directories are at the same-level, but your $webroot_dir declaration suggests bedrock is the parent directory. You’ll need to make sure the paths resolve correctly.

You can also change the path depending on the environment so it’ll still work on a default Trellis development environment:

if (WP_ENV === 'production') {
  $webroot_dir = dirname(dirname(__DIR__)) . '/public_html/subdomainfolder';
} else {
  $webroot_dir = $root_dir . '/web';
}