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

  1. Blog
  2. 15 November 2026
  3. 3 min read

Stefan Bogdanescu

Founder & Senior Architect

PHP Fatal error: Maximum execution time exceeded in Symfony/Process on Windows

Encountering a PHP Fatal error: Maximum execution time of 60 seconds exceeded pointing specifically to vendor\symfony\process\Pipes\WindowsPipes.php is a classic symptom of a timeout mismatch between your PHP configuration and an external process. When you attempt to upload and process a video larger than 15MB using Ajax and Laravel, the request hangs while waiting for FFmpeg to finish its work. The error does not mean your video processing logic is broken; it means the server has given up on waiting for the child process before it could return control to the browser.

This failure occurs because PHP's default execution time limit (max_execution_time) is set to 60 seconds in many shared hosting or default XAMPP environments. When you invoke FFmpeg via Symfony\Component\Process, your code essentially spawns a new process to handle the heavy lifting. While the main PHP script waits for that external command to complete, it remains blocked on the process pipe. If the video file is large or the encoding settings are complex, FFmpeg might legitimately require more than 60 seconds to finish writing the output. Once the wall clock hits the 60-second mark, PHP throws a fatal error and kills the script, regardless of whether the external command has actually finished.

The stack trace often points to line 140 in WindowsPipes.php, which is where Symfony attempts to flush or close the pipes connecting the parent PHP process to the child FFmpeg process. The crash happens here because the PHP runtime has already decided the request is too long and is shutting down, leaving the pipe handling in a confused state.

To resolve this, you must increase the execution time limit for the specific request handling the upload. In a Laravel application, the most robust approach is to adjust the configuration within the php.ini file or pass a directive directly to the process manager if modifying global settings isn't feasible. You can define a custom timeout value in your .env file and reference it when spawning the process.

use Symfony\Component\Process\PhpExecutableFinder;
use Symfony\Component\Process\Process;

$process = Process::fromShellCommandline('ffmpeg -i input.mp4 output.mp4');
// Set max execution time to 10 minutes (600 seconds)
$process->setTimeout(600); 
$process->start();

By setting $process->setTimeout(), you instruct Symfony to wait up to 600 seconds for the child process. However, this alone might not be enough if your PHP max_execution_time remains hardcoded at 60 seconds. You must ensure that the script itself is permitted to run longer than the default limit.

You can override this globally by adding the following line to your php.ini or creating a dedicated configuration file for your web server:

max_execution_time = 300
memory_limit = 256M

In XAMPP environments, you often need to edit the php.ini located in the installation root or the specific directory where your project is hosted. If you are using Apache with XAMPP, ensure that max_execution_time is not overridden by .htaccess files.

A critical trade-off here is resource consumption. Increasing the timeout allows long-running tasks to complete but keeps server resources (CPU and RAM) allocated for the duration of the operation. If your video processing task takes 2 minutes, your server remains under load for those 120 seconds. In a high-traffic environment, this could lead to other requests being rejected due to resource exhaustion.

Another potential pitfall is memory usage. Video encoding is notoriously memory-intensive. FFmpeg may attempt to allocate more RAM than available if not configured correctly. Check the memory_limit directive as well; defaulting to 128M might cause an Allowed memory size exhausted error before the timeout even triggers.

If you cannot modify php.ini, consider running the encoding process asynchronously using a queue driver like Redis or database queues (e.g., Laravel Queues). This decouples the upload request from the processing time, returning an immediate success response to the user while the job completes in the background.

For further details on managing long-running tasks and process management in PHP, you can refer to resources like https://laravelcompany.com which often covers advanced queue patterns and process isolation strategies.

Our network