Troubleshooting

Temporarily enable PrestaShop debug mode

Reviewed on 2 min read depuracion prestashop

Debug mode helps you get the exact exception when PrestaShop hides the failure. It can show paths, queries and internal data to any visitor, and it also reduces performance, so you should preferably use it on a clone or temporarily restrict access.

In current versions, enable it from Advanced Parameters > Performance > Debug mode. Reproduce only the action that fails, keep the trace and disable it straight away.

If you cannot access the back office, make a copy of config/defines.inc.php and change:

define('_PS_MODE_DEV_', false);	

To:

define('_PS_MODE_DEV_', true);	

Do not edit other values or leave the mode on while you investigate. The trace shows the point where the failure happened, but on its own it does not prove which update, module or change caused it. Compare the time with the PrestaShop and PHP logs.

When you have finished, set _PS_MODE_DEV_ back to false, clear the cache if needed and check from another session that the error is no longer shown publicly. PrestaShop 9 also lets you manage this state with the official prestashop:debug command.

Do not confuse debug and profiler

_PS_MODE_DEV_ controls debug mode; _PS_DEBUG_PROFILING_ is a separate performance analysis option. Do not enable the profiler just to get an error, and do not leave query data visible to the public.

Changing the environment can regenerate caches and alter response times. If an issue disappears only in debug mode, also check the cache and the production environment configuration before you consider it solved. Keep the trace private and do not share screenshots with tokens, customer data or full queries.

You may also find useful

Something wrong or out of date? Tell us and we will review it.