Technote Details :: Maximum execution time exceeded for CSV import
Issue
I have created a CSV Import Transaction using MX CSV Import-Export. When I try to import a CSV file in my database, I get the following error:
Fatal error: Maximum execution time of 30 seconds exceeded in C:\Program Files\Apache Group\Apache2\htdocs\your_site\includes\tng\tNG.class.php on line 335.
Reason
The CSV file you are trying to import contains a large number of records (possibly more than 5,000).
Solution
You can solve this problem in two ways:
- Split the CSV file into several, smaller CSV files and upload each one separately.
- Modify the max_execution_time directive in php.ini to allow the execution of scripts to take longer.
To modify the value of the max_execution_time directive, follow these steps:
- Locate the php.ini file on your server (or your local machine). On Windows, it is usually located in C:\windows\
- Open the php.ini file in a text editor.
- Search for max_execution_time and set its value to a greater one (the value is specified in seconds).
- Save the file and close it.