From the course: PHP: Creating Secure Websites

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Configure error reporting and logging

Configure error reporting and logging - PHP Tutorial

From the course: PHP: Creating Secure Websites

Start my 1-month free trial

Configure error reporting and logging

- [Instructor] In this movie, we'll learn how to configure error reporting in PHP with security in mind. There are four primary configurations for error reporting. The first is display_errors, which controls whether errors should be displayed in a browser for the user to see. Log_errors is similar but it controls whether errors should be logged to a log file. Error_reporting controls what errors are worthy of PHP's attention and error_log sets the path to the log file where we want PHP to log any errors. Ideally set each of these values in your php.ini file. They can also be set inside your PHP code itself but if there's an error before those values get set, it might not get handled the way you expect. How do we tell PHP what errors are worthy of attention? We can use some predefined error constants. A full list is available in the php.net website but I'm going to cover the most important ones. All of these constants are…

Contents