Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP - error_reporting doesn't work

Tags:

php

My webhosting provider doesn't offer the option to enable error reporting. So tried it with error_reporting(E_ALL); But this also doesn't work. I tried the following script:

 <?php
 error_reporting(E_ALL);
 echo $test;
 ?>

If I read the manual correctly, then this should generate an error notice. But this also doesn't work. Did I make something wrong or is the only solution to get a new webhosting provider?

like image 854
Crayl Avatar asked Dec 01 '22 06:12

Crayl


1 Answers

error_reporting is just telling PHP how verbose the error reporting should be, but you also need to tell it to actually display errors out to the browser by setting

ini_set('display_errors', 1);
like image 67
Andreas Wong Avatar answered Dec 20 '22 00:12

Andreas Wong