Site icon PrestaShop | Magento | CRM Modules

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

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);

 

Exit mobile version