laravel PHP 致命错误:第 140 行的 C:\xampp\htdocs\vendor\symfony\process\Pipes\WindowsPipes.php 中超出了 60 秒的最大执行时间
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/51610323/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
PHP Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\vendor\symfony\process\Pipes\WindowsPipes.php on line 140
提问by Ghyath Darwish
Error when i upload video more than 15MB using ajax and Laravel
使用 ajax 和 Laravel 上传超过 15MB 的视频时出错
Its show me this error :
它向我展示了这个错误:
PHP Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\vendor\symfony\process\Pipes\WindowsPipes.php on line 140
I use Ffmpeg
and Symfony/process
我使用Ffmpeg
和Symfony/process
the error in symfony windowsPipes.php
in laravel
symfony windowsPipes.php
Laravel 中的错误
So what is problem?
那么什么是问题呢?
回答by delboy1978uk
You can set max_execution_time in your php.ini:
您可以在 php.ini 中设置 max_execution_time:
max_execution_time=300
Or, in your PHP code:
或者,在您的 PHP 代码中:
ini_set('max_execution_time', 300); // 5 minutes
Setting it to zero removes the restriction, however apache might also time out in that scenario.
将其设置为零将取消限制,但是在这种情况下 apache 也可能超时。
Check the manual http://php.net/manual/en/info.configuration.php#ini.max-execution-time
查看手册 http://php.net/manual/en/info.configuration.php#ini.max-execution-time
This sets the maximum time in seconds a script is allowed to run before it is terminated by the parser. This helps prevent poorly written scripts from tying up the server. The default setting is 30. When running PHP from the command line the default setting is 0.
The maximum execution time is not affected by system calls, stream operations etc. Please see the set_time_limit() function for more details.
You can not change this setting with ini_set() when running in safe mode. The only workaround is to turn off safe mode or by changing the time limit in the php.ini.
Your web server can have other timeout configurations that may also interrupt PHP execution. Apache has a Timeout directive and IIS has a CGI timeout function. Both default to 300 seconds. See your web server documentation for specific details.
这设置了脚本在被解析器终止之前允许运行的最长时间(以秒为单位)。这有助于防止编写不当的脚本占用服务器。默认设置为 30。从命令行运行 PHP 时,默认设置为 0。
最大执行时间不受系统调用、流操作等的影响。更多细节请参见 set_time_limit() 函数。
在安全模式下运行时,您无法使用 ini_set() 更改此设置。唯一的解决方法是关闭安全模式或更改 php.ini 中的时间限制。
您的 Web 服务器可能有其他超时配置,这些配置也可能会中断 PHP 执行。Apache 有一个 Timeout 指令,IIS 有一个 CGI 超时功能。两者都默认为 300 秒。有关特定详细信息,请参阅您的 Web 服务器文档。
回答by Armin
Problem is that uploading is taking more then 30 sec, you could extend the maximum execution time like this, go to php.ini in your xampp and set this
问题是上传需要超过 30 秒,您可以像这样延长最大执行时间,转到 xampp 中的 php.ini 并设置它
ini_set('max_execution_time', 300); //300 seconds = 5 minutes