When I upload CSV file in symfony2 with 10000 records it gets error "Maximum execution time of 300 seconds exceeded".
当我在symfony2中上传含有10000条记录的CSV文件时,会收到错误“超过300秒的最大执行时间”。
2 个解决方案
#1
You can increase maximum execution time on your php.ini as said before. You can also split your files into smaller, lighter files and process them separately.
如前所述,您可以增加php.ini的最大执行时间。您还可以将文件拆分为更小,更轻的文件并单独处理。
#2
For bypass the the php.ini configuration you can set in your controller method the line:
为了绕过php.ini配置,您可以在控制器方法中设置以下行:
public function verySlowerAction()
{
set_time_limit(0);
....
}
#1
You can increase maximum execution time on your php.ini as said before. You can also split your files into smaller, lighter files and process them separately.
如前所述,您可以增加php.ini的最大执行时间。您还可以将文件拆分为更小,更轻的文件并单独处理。
#2
For bypass the the php.ini configuration you can set in your controller method the line:
为了绕过php.ini配置,您可以在控制器方法中设置以下行:
public function verySlowerAction()
{
set_time_limit(0);
....
}