Anytime I deploy to staging or production I get a white screen of death on the frontend. I can log in to the admin panel fine. It tends to go away after I edit something or change themes.
Any thoughts on why this is happening or how to fix it?
Well white screen just means thereās PHP errors happening. Either adjust your PHP error settings to display them, or check your server logs. We canāt help debug without knowing what the errors are.
Iāve been trying to diagnose this problem a while and had to take a break. When I came back after about 30 minutes I reloaded the site and it worked fine.
So:
Deploy to Staging and I get white screen of death with no errors.
I let it sit for ~30 minutes and it works without any intervention
from me.
Iām not sure how much I can do in this situation.
Itās either PHP errors or a problem with your web server and PHP setup (FPM). But make sure your PHP is configured to display errors, or try changing the configs in Bedrock like WP_DEBUG_DISPLAY and WP_DEBUG which are turned off on staging and production.
I have always found it to be caused by a space at the end of functions.php or another of the functions files - like the one where you put the custom posts etc - start there!
I need to ask, but did you filter out your home path or is it actually defined as <path-to-home-dir> in the cap configs? Although Iām guessing you edited it since itās also example.com.
With linked_files they need to exist on the server before it works. So youād need to manually make sure shared/.env and shared/.htaccess exist and it should work after that.
Iād probably make sure those errors are fixed and then see if you still have issues.
Yeah, I should have mentioned that - the home path and domain were filtered.
shared/.env and shared/.htaccess both exist on the server before the deploy process and are correctly linked in the current release after the deploy is finished.
-f is checking if that file exists in the specific release dir. Although it says it fails, that just means the file doesnāt exist so it then properly creates the symlinks from shared to the new release.
So basically thatās all correct and Iām back to not knowing what the problem is since Iāve never had that error about the theme.
Sorry about the thread-necro, but did you ever figure this out? Iām struggling with the same problem myself right now, and had no luck so far pin-pointing where the problem is.
After a while I figured out what was causing it in my case. $webroot_dirwas resolved to the current revision directory, which was cached/stored as a hard path for themes. When redeploying, this path would break. It would āresolveā when WordPress rechecked or figured out the path was broken. Manually overriding the variable so it would resolve to the current symlinked path instead seems to have solved most of my problems.
I can access /wp-admin but it doesnāt let me log in, throws no error, just reloads the page (if I intentionally input the wrong credentials I get an error message).
Iāve tried that aswell as rebooting the VPS instance. No luck.
I find it weird that /wp-admin is āworkingā but not the frontend?
Edit: Finally got in, not sure what locked me out of the backend.
I think the reason why the site was white was because twentyfifteen was activated, and it wasnāt present on the server.