PHP Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\vendor\symfony\process\Pipes\WindowsPipes.php on line 140

PHP Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\vendor\symfony\process\Pipes\WindowsPipes.php on line 140

当我尝试使用 Ajax 和 Laravel 上传大于 15MB 的视频时,出现此错误:

PHP Fatal error: Maximum execution time of 60 seconds exceeded in C:\xampp\htdocs\vendor\symfony\process\Pipes\WindowsPipes.php on line 140

我使用 FfmpegSymfony/process

symfony windowsPipes.php 中的错误 Laravel。

有什么问题?

问题是上传时间超过 30 秒,您可以像这样延长最大执行时间,转到 xampp 中的 php.ini 并设置此

ini_set('max_execution_time', 300); //300 seconds = 5 minutes

您可以在 php.ini 中设置 max_execution_time:

max_execution_time=300

或者,在您的 PHP 代码中:

ini_set('max_execution_time', 300); // 5 minutes

将其设置为零可消除限制,但在这种情况下,apache 也可能会超时。

查看手册 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.

在 php.ini 文件中设置 max_execution_time 可能并非在所有情况下都有效,无论如何设置一些 300[=15= 】 秒。但对于所有情况,在要执行的文件中写入 ini_set('max_execution_time', 300); 即可完成工作。