我使用 newrelic 来跟踪我网站上的所有内容,但总是收到此错误:
错误消息:E_WARNING:fclose()期望参数 1 为资源,给定布尔值堆栈跟踪:在 /etc/snmp/bfd-stats.php 调用的 fclose 中(68)
这就是/etc/snmp/bfd-stats.php看起来的样子
<?php
$a = 0;
$ptr = 0;
$any = 0;
$mx = 0;
$ns = 0;
$cname = 0;
$soa = 0;
$srv = 0;
$aaaa = 0;
$txt = 0;
$total = 0;
if(file_exists('/etc/snmp/bfd-log-pos.stat')) {
$lfh = fopen('/etc/snmp/bfd-log-pos.stat','r');
$string = fread($lfh,2087);
$res = explode(',',$string);
fclose($lfh);
}
else {
$res = array();
$res[0] = 0;
$res[1] = 0;
}
if(file_exists("/var/log/bfd_log.1")) {
$stats = stat('/var/log/bfd_log.1');
if($stats[10] > $res[0]) …Run Code Online (Sandbox Code Playgroud)