Troubleshooting Tips

If you are running into a problem with Perch it can be really handy to see what is happening “under the hood” and there are a couple of useful tips detailed in our Solutions section of the documentation that can help.

Firstly there is a Debug Mode for Perch. To enable Debug you need to switch it on in your config file:

define('PERCH_DEBUG', true);

If you have used our tip for creating a multi-environment config file you can just leave this in the section that contains your development server settings.

This setting will display debug information in Perch Admin. If you want to also output the information on your site pages then add the following to the footer of your site:

<?php PerchUtil::output_debug(); ?>

You are safe to leave this in your pages as it will only output when debug is enabled in the config.

The second useful tip is to use the Perch Tag <perch:showall /> to see what is available in your template. You would then remove that tag before deploying your site.

Remember that if you are getting a white screen with no output or the HTML output appears to stop partway through a page then you have a PHP error, and it’s hard for Perch to help you there. Your best course of action is to look in your PHP error log for the error that is being thrown.

If seeing the error or debug output doesn’t give you enough information to spot the issue, bring your findings to support. If you come into support with a PHP error, or information from debug then we will be able to help you much more quickly than if you arrive without that information.