Discrete Prestashop Debugging

Have you ever had to debug your shop while it is live? Maybe you installed a module that is not working, or a bad update and you need to figure out what is wrong with the shop with out your customers seeing all of the printed out debugging messages and hurting your sales. Or maybe you are like me and you are trying to optimize a site, but you do not want everyone seeing the debug profiling messages at the bottom of the screen. The other day I was talking to Tomer at

Presto-Changeo about it mentioned that during his speech at Prestashops’s most recent Barcamp he went over what he does. He use’s a little piece of code in the defines.inc.php that checks his IP address. Awesome idea I thought, but I have expounded upon it a little.


What You Do

You are going to need to ftp into your site and edit your /config/defines.inc.php file. Basically what I have done is added code so that when you use a query string, you can see the debugging errors and the profiling print outs. This is a pretty simple modification, if you look at the image below, the highlited lines are what I have added to the file.

Prestashop defines.inc.php



Also, instead of typing the lines out, you can use the gist below and just replace the whole defines.inc.php file. As a note, this file is written for Prestashop 1.6, but it should work with all 1.5 and 1.6 versions.

Once you have this in your defines file, you can access the debug profiling and the error reporting simply by adding ?error or ?profile to the end of your sites url. Like site.com?profile will show you the debug profiling of your site. Site.com?error will show you any error messages. If you have any problems implementing this modification, drop us a line and we will give you a hand.


About the Author: Lesley Paone

Lesley has worked in e-commerce for over a decade, and is the founder of dh42. Starting out with PrestaShop and brancing out into other platforms like Shopify. He loves all things e-commerce and loves a challenge, in his spare time he helps moderate several forums on SEO, e-commerce, as well as the PrestaShop forum. If you have any questions for him about any of his articles just use our contact form to contact him.