Introduction
The Standardized Hooks System's debug mode helps to troubleshoot hook issues. Enable this mode, for example, when you experience a bug, or to test whether hooks are functional. The tool prints debug data to the /usr/local/cpanel/logs/error_log
file.
Warning:
We strongly recommend that you perform these tests on development, rather than production, servers. This tool generates a large amount of error log noise.
cPanel & WHM version 54 and higher
To enable or disable debug mode for Standardized Hooks, we strongly recommend that you use the Standardized Hooks - Debug Mode option in the Development section of WHM's Tweak Settings interface (Home >> Server Configuration >> Tweak Settings).
This setting saves one of the following string values to the /var/cpanel/debughooks
file:
Tweak Settings option |
debughooksvalue |
Debug mode is off. |
0 |
Debug mode is on. The system displays information about a hook while it executes, but does not log debug data to the error log. |
log |
Debug mode is on. The system displays information about a hook while it executes and logs debug data to the error log. |
logdata |
Debug mode is on. The system displays information about every stage for every hookable event, even if no hooks exist for that stage. |
logall |
Note:
If the system cannot locate a valid value in the /var/cpanel/debughooks
file, it uses the debughooks
value in the/var/cpanel/cpanel.config
file as a fallback value.
- We strongly recommend that you do not update the
debughooks
value in the/var/cpanel/cpanel.config
file. Changes to this file do not override the values in the/var/cpanel/debughooks
file. - The
/var/cpanel/cpanel.config
file uses the followingdebughooks
settings:0
— Debug mode is off.1
— Debug mode is on. The system displays information about a hook while it executes, but does not log debug data to the error log.2
— Debug mode is on . The system displays information about a hook while it executes and logs debug data to the error log.3
— Debug mode is on. The system displays information about every stage for every hookable event, even if no hooks exist for that stage.
cPanel & WHM version 11.52 and earlier
Can't locate Module.pm in @INC
You may receive a Can't locate Module.pm in @INC
warning.
This error may occur for one of the following reasons:
- If your server runs cPanel & WHM version 11.44 and earlier, a module hook claims a syntax error, but the code passes the
perl -c
command, which checks the syntax of the program. This issue occurs because cPanel & WHM's internal Perl does not automatically use the same version of Perl that your system's Perl uses. - If your server runs cPanel & WHM version 11.46 and later, it is likely that the module is not installed to the cPanel-included Perl environment on your server. To troubleshoot this problem, run the
/usr/local/cpanel/3rdparty/bin/perl -c /example/script
command, where/example/script
is the location of the module file.