How to find PHP errors (error logs and display_errors)

Where PHP errors are recorded on Traxio, how to log errors without showing them to visitors, and how to set up logging for a custom application.

How-to guideIntermediate2 min readUpdated

Place 1: the domain’s error log

Open System Info & Files then Site Summary / Statistics / Logs, choose the domain and view the error log. PHP fatal errors, and web server errors such as .htaccess problems, appear here. Viewing website statistics and logs in DirectAdmin

Place 2: an error_log file

Depending on how PHP is configured, errors may also be written to a file named error_log in the folder of the script that failed. In System Info & Files then File Manager, look for error_log files in public_html and subfolders.

These files can grow large. Delete them once you’ve read them.

Showing errors temporarily

On a staging site, or briefly while you debug, you can display errors on the page. At the very top of the script:

<?php
ini_set('display_errors', '1');
error_reporting(E_ALL);

Important: Never leave errors displayed on a live site. They reveal file paths, database details and code structure.

Logging to your own file

For a custom application, log to a file outside public_html:

<?php
ini_set('display_errors', '0');
ini_set('log_errors', '1');
ini_set('error_log', '/home/USERNAME/logs/php-errors.log');

Create the logs folder first, and replace USERNAME with your DirectAdmin username.

Parse errors

A parse error in the file that sets these options happens before they run, so it goes to the server’s error log instead. Check place 1.

Not with Traxio yet? You can try this on a real server with our free PHP hosting trial: 30 days free with no card, then £0.99 a month.

Popular

Tip: press / to search from any pageSee all results