PRESTASHOP · PHP
How to Enable Error Debugging in Prestashop
Learn how to enable error debugging in Prestashop to diagnose problems and troubleshoot them efficiently.
Usually, when Prestashop store errors occur, we are faced with a white screen. Viewing the error message behind it is very important to speed up troubleshooting.
To enable error debugging in versions prior to 1.5.3, you need to find the following lines in the config.php file ( yourstore/config/config.php ).
/* Debug only */
@ini_set('display_errors', 'off');
define('_PS_DEBUG_SQL_', false);
change “off” to “on” and “false” to “true”, leaving it as in the example below:
/* Debug only */
@ini_set('display_errors', 'on');
define('_PS_DEBUG_SQL_', true);
For advanced debugging, we must also edit the defines.inc.php file ( config/defines.inc.php ) and enable debug for developers.
Find the line below in the file:
/* Debug only */
define('_PS_MODE_DEV_', false);
Change false to true, leaving it as in the example below:
/* Debug only */
define('_PS_MODE_DEV_', true);
See in the file code that there is a condition that will be executed when the constant is active, debugging not only php, but also sql queries and any compatibility issues in the store.
/* Debug only */
define('_PS_MODE_DEV_', true);
if (_PS_MODE_DEV_)
{
@ini_set('display_errors', 'on');
define('_PS_DEBUG_SQL_', true);
/* Compatibility warning */
define('_PS_DISPLAY_COMPATIBILITY_WARNING_', true);
}
else
{
@ini_set('display_errors', 'off');
define('_PS_DEBUG_SQL_', false);
/* Compatibility warning */
define('_PS_DISPLAY_COMPATIBILITY_WARNING_', false);
}
Enabling debug is the first thing to be done when you don’t know the error. After the solution, remember to disable it.
In the most current version of the store, all debug can be enabled through the defines.inc.php file (config/defines.inc.php).
In case of doubts, leave your comment.
Revisited in November 2026
The _PS_MODE_DEV_ constant in config/defines.inc.php still exists in current PrestaShop versions, so the main
route in the post still holds. Two things changed:
- Starting with PrestaShop 1.7, debug mode can be turned on and off from the back office, under **Advanced Parameters
Performance**, without editing a file. If the back office won’t open because of the error, the file is still the way out.
- In 1.7 and later, debug mode also shows the Symfony debug toolbar on back-office pages, with the queries and the time of each request.
And the post’s warning matters even more on a live store: debugging shows file paths and SQL queries to whoever is looking. Turn it on, find the error and turn it off.
Who writes this
Eduardo Lira
Software developer in Rio de Janeiro. I started this blog in 2012, in technical support at a hosting company, writing down the fixes for the problems that came up every day. Today I work at Sofis Tecnologia, on critical healthcare systems and SQL Server database migrations.