Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to force php to unsupress errors

I am using a large 3rd-party php software, which has a number of bugs I am trying to fix. However, this is very difficult to do, because it has a lot of error supression using @ - e.g. @include 'brokenfile.php';, which causes php to die without displaying any kind of error. So all I'm seeing is a blank screen, which tells me nothing. How do I force php to show errors, despite them being 'supressed'?

like image 313
Benubird Avatar asked Mar 05 '26 13:03

Benubird


1 Answers

There is an extension called scream it will disable the @ operator for debugging

From the manual:

The scream extension gives the possibility to disable the silencing error control operator so all errors are being reported. This feature is controlled by an ini setting.

Install the extension and then enable it in your php.ini:

scream.enabled = On    

Alternative:

This functionality is available with the recent xdebug version as well. You'll need xdebug installed and set

xdebug.scream = On

in php.ini

like image 182
hek2mgl Avatar answered Mar 08 '26 01:03

hek2mgl



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!