Blank page after deployment on production

I just set up a fresh WordPress installation with the bedrock project, works on local.

On first deploy on production, the website is shown and works properly.

If I ran again cap production deploy, I get a blank page with absolutely no error.

This blank page is replaced by the correct website after few minutes.

After a lot of search, I was supposing the opcache fault. So I disable it, restarted Apache and checked if really disabled (it was). But nothing change, always a blank page without error after a deployment action.

Here my deploy.rb file:

set :application, 'my-project'
set :repo_url, ''

set :branch, :master

set :log_level, :info

set :linked_files, fetch(:linked_files, []).push('.env', 'web/robots.txt')
set :linked_dirs, fetch(:linked_dirs, []).push('web/app/uploads')

set :file_permissions_paths, ["web/app/uploads"]
set :file_permissions_users, ["www-data"]

before "deploy:updated", "deploy:set_permissions:acl"

namespace :deploy do

And my production.php config file (nothing changed on application.php):

/* Production */
define('DB_NAME', getenv('DB_NAME'));
define('DB_USER', getenv('DB_USER'));
define('DB_PASSWORD', getenv('DB_PASSWORD'));
define('DB_HOST', getenv('DB_HOST') ? getenv('DB_HOST') : 'localhost');

define('WP_HOME', getenv('WP_HOME'));
define('WP_SITEURL', getenv('WP_SITEURL'));

ini_set('display_errors', 0);
define('WP_DEBUG_DISPLAY', false);
define('SCRIPT_DEBUG', false);
define('DISALLOW_FILE_MODS', !$is_wp_cli); // this disables all file modifications including updates and update notifications

Obviously, I tried many Apache restart/reload just after the deploy. But it doesn’t affect anything.

Without error, it’s quite difficult to point the problem source.

Anybody having the same issue? How to solve it?


1 Like

What do your logs say?

The Apache logs? Absolutly nothing, that’s the problem.

Well it’s pretty hard to debug without errors. You could modify the production config to show them.

I agree, it’s why I’m here! :wink:

Just edited the production.php lines:

//ini_set('display_errors', 0);
define('WP_DEBUG_DISPLAY', true);
define('SCRIPT_DEBUG', true);

And restarted Apache. No error.

Have you tried accessing the WordPress dashboard? It could be related to the theme’s real path changing after the deploy.

1 Like

@Foxaii, thanks that was it. Was getting the blank page after I changed my development url throughout my project. I was able to access the dashboard. I had to re-activate the theme (updated Permalinks as well for good measure) and everything worked again.