Correct a blank page on prestashop

You have a blank page? a bug without error message?

To enable the display of error messages in order to correct the problems, several possibilities:

 

 

1 - simple display to all the world

the file config/defines.inc.php at the beginning you have:


if (!defined('_PS_MODE_DEV_')) {
define('_PS_MODE_DEV_', false);
}

need to replace false to true:

if (!defined('_PS_MODE_DEV_')) {
define('_PS_MODE_DEV_', true);
}

 

This solution brings a little problem, error messages are visible to all your customers but also google which can reference your pages with these error messages.

 

 

2 - display according to the IP address of a single person.

 

How not to display the error messages for all the world?

_PS_MODE_DEV_ must be true for your IP address, example with IP address 127.0.0.1:


if (!defined('_PS_MODE_DEV_'))
define('_PS_MODE_DEV_', ($_SERVER['REMOTE_ADDR'] == '127.0.0.1'));

 

 

3 - display according to the IP address for several people.

 

And now if you want to display messages to several people (you, your webmaster...), just have the list of the IP addresses of the various persons concerned.

E.g. with the 127.0.0.1 IP addresses 127.0.0.2 and 127.0.0.3


if (!defined('_PS_MODE_DEV_')){
$list_ip = array('127.0.0.1', '127.0.0.2', '127.0.0.3');
define('_PS_MODE_DEV_', in_array($_SERVER['REMOTE_ADDR'], $list_ip));
}