Script timeout passed, if you want to finish import, please resubmit the same file and import will resume

Script timeout passed, if you want to finish import, please resubmit the same file and import will resume

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

Stefan Bogdanescu

Founder & Senior Architect

Script timeout passed, if you want to finish import, please resubmit the same file and import will resume

When a database import stalls after uploading a zipped file, the error message Script timeout passed is often the first thing developers see. The user in the source material increased PHP configuration values like max_execution_time and memory_limit to astronomical numbers—setting execution time to 50 days and memory limits far exceeding physical RAM. Despite these tweaks, the import still failed with the same resubmit prompt. This discrepancy points to a fundamental misunderstanding of how web servers handle long-running tasks versus server-side process management.

The core issue lies in the distinction between max_execution_time and the request lifecycle managed by the web server or application framework. Even if you set max_execution_time = 3000000, this setting only applies to a standard PHP script running within an Apache, Nginx, or built-in server context. If your environment uses a reverse proxy like Nginx in front of PHP-FPM, the timeout might actually be enforced by Nginx itself, which typically defaults to 60 seconds unless explicitly configured otherwise. Furthermore, web servers often terminate connections that do not send data within a specific window (e.g., proxy_read_timeout), cutting off the request before the PHP script even finishes parsing the upload or executing the first SQL statement.

The error message "if you want to finish import, please resubmit the same file and import will resume" is a critical clue. It indicates that the application logic uses resumable uploads, likely via chunked processing or session-based state management. This pattern is common in large data migrations where the system breaks the import into manageable chunks. When the script hits a timeout—whether due to web server limits, firewall timeouts, or infrastructure load balancers—it abandons the current session and waits for a fresh request. The "resubmit" instruction implies that the application expects a new HTTP POST request containing the file data (or a reference to it) to continue the operation from the last successful checkpoint.

However, simply resubmitting the exact same zipped file does not guarantee success if the underlying cause isn't resolved. If the web server or load balancer is configured with strict timeouts (e.g., 30 seconds for client body size), the file upload itself will fail before the import script even starts. A 7MB file is small in terms of size, but if the network connection drops or the server kills idle connections during the parsing phase, the request times out instantly. The source material's configuration shows upload_max_filesize set to roughly 4TB (40964564M), which is valid PHP syntax but physically impossible given that most servers have limited RAM and swap space. Setting memory limits this high doesn't help if the process runs out of file descriptors or hits an OS-level limit on open files.

To allow the system to take its own time, you must adjust the timeout layers beyond just php.ini. Check your web server configuration (e.g., Nginx's client_max_body_time or Apache's LimitRequestBody and Timeout). If you are using a load balancer like AWS ALB or NGINX Plus, ensure the idle connection timeouts are extended to match your expected import duration. Additionally, consider running the import outside of the web request cycle entirely. Tools like Laravel's queue system (php artisan queue:work) or direct CLI execution of the import script bypass HTTP timeouts and web server limits completely.

If you must use the web interface, implement a "long-polling" approach or use WebSocket connections to keep the session alive while the import progresses. Alternatively, verify that the database engine supports partial imports (e.g., MySQL's LOAD DATA INFILE with specific flags or SQL Server's transactional logging) so that the process can truly resume from the last committed state without data corruption risks.

Ultimately, relying solely on increasing max_execution_time in php.ini is insufficient because web servers and firewalls will terminate the connection before the PHP script reaches its timeout limit. The solution requires a holistic view of the request lifecycle, ensuring every layer—from the client upload to the database commit—is configured to handle extended durations.

Our network