Prestashop logo, Visit home page

The debug mode

-

For your own needs, or on request from the support teams, you may have to activate the debug mode. There are two ways to activate this mode.

 

Via the back office

The most direct solution is to go through the back office of your store, if you still have access to it of course. Once this mode is activated, error indicators will appear at the bottom of the page.

To access it, go to : Advanced settings > Performance > Debug mode > Yes > Save

 

 

To deactivate the debug mode, you just have to click on the bug icon at the top of the page, then put the button back to the No position, and save.

 

💡 Please note: this type of debug mode can cause error messages to appear on the front office of your store, visible to any user. To prevent this from happening, you can put your store in maintenance mode, or set the debug mode via FTP, in your store files.

 

Via FTP

To enter in debug mode from your files, go on your FTP and find in the file /config/defines.inc.php the following lines :

/* Debug only */
if (!defined('_PS_MODE_DEV_')) {
	define('_PS_MODE_DEV_', false);
}


To activate the simple debug mode, simply replace the value "false" by "true". This is the same type of debug mode as the one available on the back office.

/* Debug only */
if (!defined('_PS_MODE_DEV_')) {
	define('_PS_MODE_DEV_', true);
}


To avoid error messages appearing on your front office, opt for a debug mode based on your IP address. This way, error messages will not be visible to any user on your store.

/* Debug only */
if (!defined('_PS_MODE_DEV_')) {
	define('_PS_MODE_DEV_', $_SERVER['REMOTE_ADDR'] 
== "VOTRE IP" || $_SERVER['HTTP_X_REAL_IP'] == "VOTRE IP"); }

 

Any modification on your store files can cause to irreversible errors. Don't forget to make regular backups, and if you have any doubts, don't intervene yourself on your files.

 

Related articles


 

Share