blank white page / 500 internal server errorAA-00207If when visiting your site or a specific web page that uses php and you see a white page, or a '500 internal server error' message this is normally caused by a php coding error. To get more information on what the cause is, and how to fix it php 'display errors' should be enabled. Below is 2 methods to enable 'display errors' The quickest way to display all php errors and warnings is to add these lines to your PHP code file: ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
What Do These Lines of Code Do Exactly?The ini_set function will try to override the configuration found in your PHP ini file. The display_errors and display_startup_errors are just two of the available directives. The display_errors directive will determine if the errors will be displayed or hidden from the user. Usually, the dispay_errors directive should be turned off after development. The display_startup_errors, however, is a separate directive because the display_errors don’t handle the errors that will be encountered during PHP’s startup sequence. The list of directives that can be overridden by the ini_set function is found in the official documentation. Unfortunately, these two directives won’t be able to display parse errors such as missing semicolons or missing curly braces. In this case, the .htaccess file must be edited. Display PHP errors via .htaccess configurationDevelopers usually have access to the directory files. The directive for showing PHP errors can also be enabled or disabled using the .htaccess file located in the root or public directory of the project. php_flag display_startup_errors on php_flag display_errors on Similar to what will be added to the PHP code to show PHP errors, .htaccess also has directives for display_startup_errors and display_errors. The advantage of showing or disabling error messages in this manner is that development and production can have different .htaccess files, where the production suppresses the displaying of errors. php_value error_log logs/all_errors.log |