3

I have a staging server running a Yii application that now gives a 'white screen of death'. I cannot see anything being ouputted to the screen (or even the source code when 'view source'), locally the same code runs without any issues.

Can anyone suggest a good routine to debug 'white screen of death' within a Yii application?

Zabs
  • 13,852
  • 45
  • 173
  • 297

3 Answers3

8

Getting a blank screen in yii is mostly because error_reporting is off. Put

error_reporting(-1);
ini_set('display_errors', true);

in index.php should get your output back.

Note that you can always look in application.log and apaches error.log for informations when you don't have some output.

chris---
  • 1,536
  • 1
  • 13
  • 14
0

This is for Yii2

I found the code was failing in vendor/yiisoft/yii2/BaseYii.php at method autoload($className). It was failing at execution:

include $classFile; (line 293)

The cause in my case was a function method name declared twice.

You might be interested to know that you can discover the cause (which Yii2 suppresses through its own error-handling) by preceding the command with Chris's recommended code above https://stackoverflow.com/a/25139283/3125602. If you introduce them too early in the code, they get overwritten by Yii2's error-handling settings.

quinny
  • 656
  • 1
  • 7
  • 24
-1

It is quite a simple issue and happens either when a script reaches the PHP memory limit or during a plugin or theme conflict.

Solutions :

  1. Increase the Memory Limit :

Since this is regarded as one of the cause, it is recommended that the PHP memory limit be increased. Edit your wp-config.php file via FTP adding the following line of code: define( ‘WP_MEMORY_LIMIT’, ‘64’);

This increases your memory limit to 64M. You might need to contact your host before you do it as some host don’t allow it from your end.

  1. Deactivate all your Plugins :

Connect to your site via FTP and rename the wp-content/plugins folder to plugins_old to deactivate all your plugins.

Here is a detailed answer to the infamous "White Screen of Death" problem. Thank me later :)

https://www.perceptionsystem.com/blog/wordpress-errors-solution/