PHP/Javascript-谷歌图形导致循环错误(PHP)

PHP/Javascript-谷歌图形导致循环错误(PHP),php,mysql,graph,charts,Php,Mysql,Graph,Charts,好了,伙计们,我的服务器错误中出现了这个错误,它是由我在我的网站的一个页面上显示的谷歌图引起的。在页面上加载图形一段时间后,循环失控,服务器内存不足,我的cPanel出现了严重的i/O错误 [22-Oct-2014 19:14:23 UTC] PHP Warning: fgets() expects parameter 1 to be resource, boolean given in /home/gift3dsaint/public_html/graph.php on line 44

好了,伙计们,我的服务器错误中出现了这个错误,它是由我在我的网站的一个页面上显示的谷歌图引起的。在页面上加载图形一段时间后,循环失控,服务器内存不足,我的cPanel出现了严重的i/O错误

[22-Oct-2014 19:14:23 UTC] PHP Warning:  fgets() expects parameter 1 to be resource, boolean given in /home/gift3dsaint/public_html/graph.php on line 44  
[22-Oct-2014 19:14:23 UTC] PHP Warning:  feof() expects parameter 1 to be resource, boolean given in /home/gift3dsaint/public_html/graph.php on line 42  
[22-Oct-2014 19:14:23 UTC] PHP Warning:  fgets() expects parameter 1 to be resource, boolean given in /home/gift3dsaint/public_html/graph.php on line 44  
[22-Oct-2014 19:14:23 UTC] PHP Warning:  feof() expects parameter 1 to be resource, boolean given in /home/gift3dsaint/public_html/graph.php on line 42  
[22-Oct-2014 19:14:23 UTC] PHP Warning:  fgets() expects parameter 1 to be resource, boolean given in /home/gift3dsaint/public_html/graph.php on line 44  
[22-Oct-2014 19:14:23 UTC] PHP Warning:  feof() expects parameter 1 to be resource, boolean given in /home/gift3dsaint/public_html/graph.php on line 42  
我引用的图形代码如下所示:

 $lines=array();
 $fp = fopen($file, "r");
 while(!feof($fp)) {
      $line = fgets($fp, 4096);
      array_push($lines, $line);
 }
 fclose($fp);

$file open调试失败;请下次只发布相关代码。$file open调试失败。请详细说明一下好吗?fgets抱怨$fp不是资源$fp应该是从fopen返回的资源,但由于它是布尔值,fopen失败并返回一个布尔值错误,而不是资源。fopen正在尝试打开文件$file,因此这就是问题所在。