超过错误的最大执行时间为60秒 [英] Maximum execution time of 60 seconds exceeded error

查看:203
本文介绍了超过错误的最大执行时间为60秒的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到以下错误消息:

警告:file_get_contents( http://localhost/sample_pie.php )[function.file-get-contents ]:打开流失败:连接尝试失败,因为一段时间后连接方未正确响应,或者连接建立失败,因为连接的主机未能响应.在第206行的C:\ xampp \ htdocs \ EXACT \ report.php中

Warning: file_get_contents(http://localhost/sample_pie.php) [function.file-get-contents]: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond. in C:\xampp\htdocs\EXACT\report.php on line 206

致命错误:第206行的C:\ xampp \ htdocs \ EXACT \ report.php中超过60秒的最大执行时间

Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\EXACT\report.php on line 206

这是第206行:

$url = 'http://localhost/sample_pie.php';
$img = 'C:\xampp\htdocs\piechart.jpg';
file_put_contents($img, file_get_contents($url));

我该怎么做才能解决此问题?

What do I have to do to fix this?

推荐答案

您的脚本执行了60秒钟以上,并被终止. php.ini中有一个值定义了PHP脚本可以运行的最长时间.这样做的目的是防止脚本挂起.您可以尝试优化脚本,但是如果打算将脚本运行这么长时间,则只需更新该值(称为max_execution_time)即可.

Your script executed for more then 60 seconds and was terminated. There is a value in php.ini defining maximum time PHP script can run. The purpose of this is to prevent scripts from hanging. You could try to optimize your script but if it's intended to run for so long you can just update the value (it's called max_execution_time).

您还可以尝试通过运行set_time_limit()函数此处的文档

You can also try changing this value for particular script by running set_time_limit() function, docs here

这篇关于超过错误的最大执行时间为60秒的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆