Displaying the PHP error on websites is important and helpful for solving different problems. For example:
-If blank page displayed instead of content on your site or
-If you are getting 500 error message on the website page.
Blank page is mostly caused by some PHP error in the code. If you have enabled the error reporting then it is very easy to find the error and solve the problem.
You can set PHP error reporting in php.ini file. You will need to set the following lines:
error_reporting = E_ALL display_errors = On
If you have installed your server e.g. with help of XAMPP, see the documentation where to find the php.ini file. Don’t forget to stop Apache server before doing modifications and start it again after saving these modifications.
You can also modify .htaccess file on the server if you don’t have access to php.ini file. Add the below code in the .htaccess file:
# Displaying PHP errors php_flag display_errors on php_value error_reporting 6143
If you can’t access the .htaccess file or your modifications in the file have no effects, try to ask your webhosting provider for enabling error reporting or try to see your error log file.
After you will get the information about the problem and you will solve this problem, you should disable php error reporting again, so no error will be displayed for the public (because of security reasons).
Thanks:)
If you find this tutorial helpful please share with your friends to keep it alive. For more helpful topic browse my website www.looklinux.com. To become an author at LookLinux Submit Article. Stay connected to Facebook.
Leave a Comment