超出最大执行时间 60 秒错误

发布于 2024-08-04 11:29:52 字数 573 浏览 2 评论 0原文

我收到以下错误消息:

警告: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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

合久必婚 2024-08-11 11:29:52

您的脚本执行了超过 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

葮薆情 2024-08-11 11:29:52

max_input_time 也会导致同样的错误。

max_input_time can also cause the same error.

羁客 2024-08-11 11:29:52

只需增加 php.ini 中的 max_execution_time 即可。将其设置为 1800 并重新启动 apache 或您正在使用的任何其他服务器。

Just increase the max_execution_time in php.ini. Set it to 1800 and restart your apache or any other server you are using.

深居我梦 2024-08-11 11:29:52

该错误意味着 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?

爱已欠费 2024-08-11 11:29:52

这意味着 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.

狠疯拽 2024-08-11 11:29:52

我正在使用 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文