超出最大执行时间 60 秒错误
我收到以下错误消息:
警告:file_get_contents(http://localhost/sample_pie.php) [function.file-get-contents ]:打开流失败:连接尝试失败,因为连接方在一段时间后没有正确响应,或者由于连接的主机未能响应而建立的连接失败。在 C:\xampp\htdocs\EXACT\report.php 第 206 行
致命错误:第 206 行 C:\xampp\htdocs\EXACT\report.php 中的最大执行时间超过 60 秒
这是第 206 行:
$url = 'http://localhost/sample_pie.php';
$img = 'C:\xampp\htdocs\piechart.jpg';
file_put_contents($img, file_get_contents($url));
做什么我必须做什么来解决这个问题?
I'm getting the following error message:
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
Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\EXACT\report.php on line 206
Here is the line 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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
您的脚本执行了超过 60 秒并被终止。 php.ini 中有一个值定义 PHP 脚本可以运行的最长时间。这样做的目的是防止脚本挂起。您可以尝试优化您的脚本,但如果它打算运行很长时间,您只需更新该值(称为
max_execution_time
)。您还可以尝试通过运行 set_time_limit() 函数来更改特定脚本的此值,
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
).You can also try changing this value for particular script by running set_time_limit() function, docs here
max_input_time
也会导致同样的错误。max_input_time
can also cause the same error.只需增加
php.ini 中的
max_execution_time
即可。将其设置为1800
并重新启动 apache 或您正在使用的任何其他服务器。Just increase the
max_execution_time
inphp.ini.
Set it to1800
and restart your apache or any other server you are using.该错误意味着 PHP 无法打开 http://localhost/sample_pie.php 来读取以下内容文件。看看您是否能够在浏览器中打开 http://localhost/sample_pie.php 文件。
还有页面很大吗?
The error means that PHP is not able to open http://localhost/sample_pie.php to read the contents of the file. See if you are able to open the http://localhost/sample_pie.php file in browser.
Also is the page very large?
这意味着 PHP 无法访问资源
http://localhost/sample_pie.php
,因此操作超时。尝试通过浏览器访问它。It means PHP was unable to access the resource
http://localhost/sample_pie.php
, and thus the operation timed out. Try to access it through the browser.我正在使用 ffmpeg,并且有视频上传,并且 ffmpeg 会在临时文件上复制一些文件,而我的防病毒程序会阻止复制,并且超出了最大执行时间 60 秒。
我删除了防病毒程序,发现问题消失了
I was using ffmpeg and there is video uploading and ffmpeg copies some files on temp and my anti virus program blocks that copying and there is Maximum execution time of 60 seconds exceeded
I REMOVED ANTİVİRUS PROGRAM I SAW PROBLEM GONE OFF