简体   繁体   English

使用PHP清除error_log文件

[英]Clear error_log file with PHP

Okay, so my error log files are getting filled up really fast due to some unfixable errors (they exist due to the site's design) and it's using up a lot of my webspace pretty fast. 好的,由于一些无法修复的错误(由于网站的设计而存在),我的错误日志文件很快就被填满了,并且它很快就耗尽了我的很多Web空间。

However, I do not need the error_log files at all. 但是,我根本不需要error_log文件。 I've been looking around and I cannot find a way to stop error_logs in cPanel, so I thought that perhaps I could run a script on each page a user visits that empties or deletes the error_log file. 我一直在环顾四周,找不到在cPanel中停止error_logs的方法,所以我认为也许可以在用户访问的每个页面上运行一个脚本,以清空或删除error_log文件。

Is this possible? 这可能吗? the error_log file is in the document root of each of my websites error_log文件位于我每个网站的文档根目录中

您可以使用相应的php.ini设置禁用错误日志记录: http : //php.net/manual/en/errorfunc.configuration.php#ini.log-errors

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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