简体   繁体   中英

PHP turn off all errors but save errors to error_log

I'm on a shared hosting and want to hide all errors from the visitors so I use error_reporting(0) but this will lead to erros not saving in the error_log file that's created in the directory where the file is located. How to turn off erros but add them to the error_log?

Tried display_errors,0 but it seems my shared host is not allowing the edit of ini

Thanks

ini_set("display_errors", 0);
ini_set("log_errors", 1);

//Define where do you want the log to go, syslog or a file of your liking with
ini_set("error_log", "syslog");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM