How to turn on error reporting in PrestaShop (with IP condition)


PrestaShop is a complicated system which sometimes crashes. If you see blank pages on your store, or something does not work correctly you may want to switch developers mode. This special mode allows to identify problem and fix it.

developers mode PrestaShop


How to enable error reporting in PrestaShop?

We will use ftp to condust this operation, so you will have to have ftp client and login data.

Please open defines.inc.php which is in config folder and change this line:

define('_PS_MODE_DEV_', false);


to:

define('_PS_MODE_DEV_', true);


You really should restrict displaying errors to  the smallest group of people. You can do so by adding an IP condition.

First check your IP address. You can do it easily by visiting one of many 'check my ip' sites (ie.:whatismyip.com).

Now replace line of code that we have eddied before by:

define('_PS_MODE_DEV_', $_SERVER['REMOTE_ADDR'] == 'xxx.xxx.xxx.xxx' ? true : false);


Obviously change xxx.xxx.xxx.xxx to your own IP.

After saving changes you should be able to see errors and warnings on your PrestaShop store. This should be helpful in tracking and fixing bugs.

What should you remember about?

After fixing or sending error log to your PrestaShop developers, please remember to switch off developers mode (define('_PS_MODE_DEV_', false)).

In order to ensure maximum convenience to users when using the website, this page uses cookie files. Detailed information is available in our Privacy Policy. Click " I agree", so that this information is no longer shown