Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

logs php error but not display it in browser

i want to create the error logs but not to display it in browser.

Currently when an error or warning/notice is occurs, then logs is created and error is displayed to the browser but i want to force the system to not show the error message in browser to the site visitor but create the logs for me.

Thanks

like image 854
user2223377 Avatar asked Feb 17 '23 17:02

user2223377


1 Answers

Make sure you have something like this in your php.ini:

display_errors = Off
error_log = /var/log/php/error.log # Assuming you have /var/log/php directory and it's writable by httpd
error_reporting = E_ALL & ~E_DEPRECATED

Or set them as run-time options with ini_set()

like image 147
Roman Newaza Avatar answered Feb 23 '23 01:02

Roman Newaza