HomeAdmin ManualTroubleshooting GuidesDebugging HelpSpot

11.2. Debugging HelpSpot

Most systems have PHP configured to not display errors, often for security reasons. This can result in errors only showing blank white screens, which is hardly useful when testing development of HelpSpot features such as BlackBox authentication, Request Push or Active Directory integrations.

Here we'll cover a few ways to have PHP return actual errors that are useful for debugging.

Linux Error Logs

Without having to do any configuration, there are typically error logs on servers using Apache and Nginx web servers. Both web servers may be configured to not send errors to log files, however this is not a typical case. You may find useful error logs in the following locations:

Note that the "error.log" file may not be present or may not be the one configured to receive errors from your HelpSpot site, depending on your webserver configuration.

Windows Server customers using IIS  unfortunately have a harder time finding error logs, as IIS does not keep a accessible log of PHP errors. 

PHP Configuration

We can configure PHP to display errors within the php.ini file. That php.ini file may be in a few different places depending on your system:

Within these files, you can edit two parameters to get errors to appear:

After updating php.ini, you'll need to restart Apache and/or PHP-FPM if they are used. Windows users should see these changes take effect immediately. 

HelpSpot 3 and Under

Note that HelpSpot files admin.php (staff login) and index.php (portal) disable the above configuration in code, so the above configuration changes are best for when testing external scripts, such as BlackBox authentication, request push, converting database attachments to files, and other external scripts.

If you want to enable these from within HelpSpot to debug an issue, you can contact us on how best to do that.

In-Code

You can set specific scripts to display errors and set the error reporting level. This is equivalent to configuring the php.ini file as described above, except these can (usually) be set dynamically as the script is running. Note that some hosting may disable this ability for security reasons.

The equivalent PHP code to edit error_reporting and display_errors configurations are:

error_reporting(E_ALL);
ini_set('display_errors', '1');

 

Those should be set as early in your PHP code as possible. For example, in a Live Lookup MySQL integration script:

<?php
// Set error reporting immediately
error_reporting(E_ALL);
init_set('display_errors', '1');

/***** DATABASE CONNECTION VARIABLES *****/
$host = "localhost";
$user = "";
$pswd = "";
$name = ""; //database name

/***** CONNECT TO DATABASE *****/
$link=mysql_connect($host,$user,$pswd);

// And so on...

 

HelpSpot 4

As of version 4, HelpSpot can be configured to display more useful error messages. To enable debugging, edit your config.php file and add or change the cDEBUG option to appear like so:

define('cDEBUG',      true);

This will do two things:

This page was: Helpful | Not Helpful