duanche8554 2014-10-22 19:34
浏览 37

PHP / Javascript - Google Graphs导致循环错误(PHP)

Okay guys so I have this error coming up in my server errors and its being caused by Google Graph I have displayed on one of the pages of my site. After some time with the graph loaded on the page this loops out of control and the server runs out of memory and i get major I/O errors on my cPanel.

[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  

The code I have referencing to the graph is this PHP:

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

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 微信会员卡接入微信支付商户号收款
    • ¥15 如何获取烟草零售终端数据
    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向
    • ¥15 如何用python向钉钉机器人发送可以放大的图片?