Skip to content
PHP Logo

What command can be used in PHP to output errors for easier debugging?

To output errors for easier debugging in PHP, you can use the error_reporting() function along with the ini_set() function to set the error reporting level and display errors on the screen. This can help you identify and fix any issues in your code more easily.

php
// Set error reporting level
error_reporting(E_ALL);

// Display errors on screen
ini_set('display_errors', 1);