Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jegjessing's avatar

How to disable E_DEPRECATED

I just cannot make laravel stop showing the E_DEPRECATED warning. I know the problem, unfortunately the "product" generating this warning is tcpdf so it is not for me to fix. Therefore I just want to disable this. I've set: error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED and display_error = 0 in php config, but laravel STILL show this error. How can I disable the E_DEPRECATED warning, without hacking into laravel :-)

Thanks in advance

0 likes
6 replies
shez1983's avatar

its not laravel, its PHP afaik..

also try adding error_reporting = off.

but googling around your error_reporting thing should have worked (is that in php.ini or anywhere else?)

jegjessing's avatar

Yeah well no, does not work. And I've tried to Google but have given up since nothing worked. That is why I also here :-(

Cronix's avatar

try putting

error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);

in the boot() method of AppServiceProvider.

2 likes
semseddin's avatar

@Cronix Finally! It worked. Whatever I did, I couldn't stop displaying that error.

martinbean's avatar

@ricvillagrana @semseddin You should be acting on deprecated warnings instead of trying to suppress them. You should also be testing PHP version upgrades locally—and catching such deprecations—before rolling code out on production.

Please or to participate in this conversation.