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:
- PHP errors & warnings
- Symfony exceptions
- SQL errors
- File & line numbers
๐งช Enable Debug Profiling (Performance Debug)
This shows:
- SQL queries
- Execution time
- Memory usage
- Controller + hook execution
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:
- 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
| Type | Location |
|---|---|
| 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);
ย
