How to Enable PHP Error Logging for Joomla
Prefer logging over displaying errors on production
PHP's own manual strongly recommends logging errors instead of displaying them on production websites. Displayed PHP errors can expose filesystem paths, configuration details, database information, or other sensitive data to visitors. Keep display_errors off on a public site and collect diagnostics in protected logs.
Identify where PHP configuration is controlled
The available method depends on the host and PHP handler. Managed hosting may provide a PHP configuration editor, while a VPS may use php.ini, PHP-FPM pool configuration, or another server-level file. Do not assume that a .htaccess directive is supported, because that depends on the server and PHP integration.
Enable PHP error logging
Set PHP's log_errors directive to On using the supported configuration method for the server. PHP documents log_errors as the switch that sends script error messages to the server error log or to the destination configured by error_log. Apply or reload the PHP service if the hosting environment requires it.
Choose or verify the error_log destination
If you set PHP's error_log directive to a file, use a location writable by the web-server or PHP process and not publicly downloadable. PHP can also send errors to syslog or, when no explicit destination is set, to the SAPI logger. Confirm the active value after changing configuration.
Keep an appropriate error_reporting level
For diagnosis, PHP error_reporting determines which classes of PHP errors are reported. Use the host's supported production configuration and avoid suppressing the specific failure you need to investigate. Changing Joomla's Error Reporting setting does not necessarily replace server-level PHP logging configuration.
Generate a controlled test and verify the log
After enabling logging, reproduce the original Joomla error or use a safe test in a non-production environment. Confirm that a new entry appears at the expected time and destination. If nothing is logged, verify which php.ini or PHP-FPM configuration the website actually uses and whether the log destination is writable.
Restore a secure steady-state configuration
Once diagnosis is complete, keep useful server-side error logging if it is part of your operational policy, but remove temporary test code and excessive debug output. Leave display_errors disabled for public production traffic and protect, rotate, and retain logs according to the site's security and privacy requirements.
Need More Help with Joomla?
Still having trouble? Open a support ticket with QuantaCade Support and we'll be happy to help where we can.
Support priority is given to QuantaCade products, services, and customers. However, we're also happy to assist fellow Joomla users with general Joomla questions and troubleshooting when possible.
QuantaCade is an independent Joomla extension developer and is not official Joomla support. Some issues involving third-party extensions, hosting environments, server configurations, or other systems outside our development control may be beyond what we're able to resolve.