Microsoft Azure Open Source Development Support Team Blog

Support for Open Source Technologies on Microsoft Azure App Service

Info About PHP Fatal Error and Error Log on Azure Website

1. E_ERROR – Fatal run-time errors. These are the errors that can not be recovered, execution of the script is halted (

2. When fatal errors happen, you could see http 500 internal server error or a blank page on your browser

3. PHP error log is an important log file for troubleshooting. if you use default php runtime environment on Azure website, this log file is default to “php_errors.log”, in LogFiles directory, it is predefined in pnp.ini, you can see it in phpinfo page, eg.


4. Broadly used directives for error display and error logging include:

error_reporting – set the error reporting level, see predefined constants for values (

display_errors – determines if errors should be displayed to screen, it takes string value “On” or “Off”

display_startup_errors – Errors that occur during PHP startup are not displayed even display_errors is turned on. This could happen when there are parse errors. You need to turn on display_startup_errors for these cases. This option is recommended for debugging only.

log_errors – determines whether script error messages should be logged to server’s error log

error_log – It defines the path where script errors should be logged.

Refer to for more detail.


5. How to enable error log

Most errors and logging options can be set in user script using ini_set() or user level ini file. When you see log_errors is Off from phpinfo, you can turn it on in .user.ini, eg.


6. Manage error log file

By default, PHP log all types of errors (E_ALL, integer value 32767).

With current implementation on Azure, php_errors.log is not managed by system, you need to maintain it to proper size. You can reduce the volume of log message by changing error log level.

In production environment, it is reasonable to stop logging E_NOTICE, E_STRICT, E_DEPRECATED, to exclude these errors, reset the value of error_reporting in .user.ini, eg.

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED


Check phpinfo to confirm the change: