secondsight secondsight - 1 month ago 9
PHP Question

Not displaying errors in php

I am debugging some errors in my

PHP
bus booking site. My issue is that I am not able to display errors. When I googled this issue it shows you can achieve it though
php.ini
. But unfortunately I haven't find any
php.ini
file .

Now the error is showing as


This page isn’t working

cableandmedia.com is currently unable to handle this request. HTTP
ERROR 500

Answer Source

On your all-pages/or-a-common-file which-is-included-in-each-file.

On top just after starting <?php add these two lines:-

error_reporting(E_ALL);
ini_set('display_errors',1);

If you have php.ini file then check these two variables:-

display_errors
error_reporting

Now change these variables values to:-

display_errors=ON
error_reporting=E_ALL

Now save the file and restart your server(important if you are working on localhost).And you have good to go.