Site icon PrestaShop | General Knowledge

Prestashop how to enable debug mode and debug profiling from settings files

Perfect timing for this one โ€” debug mode is the fastest way to find whatโ€™s really broken in PrestaShop ๐Ÿ”ง๐Ÿ˜„
Iโ€™ll show you file-based (settings file) methods, not Back Office clicks.


โœ… Enable Debug Mode (from settings files)

๐Ÿ”น PrestaShop 1.7 & 8.x (Recommended way)

Edit this file:

/config/defines.inc.php

Find:

define('_PS_MODE_DEV_', false);

Change to:

define('_PS_MODE_DEV_', true);

Save and refresh your site.

What you get:


๐Ÿงช Enable Debug Profiling (Performance Debug)

This shows:

In the SAME file:

/config/defines.inc.php

Add or set:

define('_PS_DEBUG_PROFILING_', true);

Full example:

define('_PS_MODE_DEV_', true);
define('_PS_DEBUG_PROFILING_', true);

๐Ÿ“Œ Youโ€™ll see a debug bar at the bottom of front-office pages.


๐Ÿงฏ Disable Friendly Errors (Optional but Useful)

Still in defines.inc.php, add:

define('_PS_DISPLAY_COMPATIBILITY_WARNING_', true);

Helps catch deprecated functions.


๐Ÿ” Clear Cache (Very Important)

After enabling debug:

  1. Delete cache manually:
/var/cache/*

(keep .htaccess)

OR via BO:
Advanced Parameters โ†’ Performance โ†’ Clear cache


๐Ÿงฉ If Errors Still Donโ€™t Show

Enable PHP error display (Hosting-level fallback)

Edit:

/config/config.inc.php

Add at top:

ini_set('display_errors', 'on');
ini_set('display_startup_errors', 'on');
error_reporting(E_ALL);

โš ๏ธ Use this only for debugging.


๐Ÿ—‚ Where Logs Are Stored

TypeLocation
PrestaShop logs/var/logs/
Symfony logs/var/log/prod.log
Dev logs/var/log/dev.log

๐Ÿšจ IMPORTANT WARNING

โš ๏ธ NEVER leave debug enabled on live site

After fixing:

define('_PS_MODE_DEV_', false);
define('_PS_DEBUG_PROFILING_', false);

๐Ÿง  Bonus: Debug Specific Page / Controller

Add this to URL:

?debug=1

Works only when _PS_MODE_DEV_ is enabled.


โœ… Quick Copy-Paste Block

// Debug mode
define('_PS_MODE_DEV_', true);

// SQL + performance profiling
define('_PS_DEBUG_PROFILING_', true);

ย 

Exit mobile version