PHP脚本在360秒后停止,并显示500个大型文件的服务器错误 [英] php script stops after 360 seconds and shows 500 server error for large files
问题描述
我正在处理csv文件上传. 3MB文件工作正常.但是当我尝试上传8MB文件时,它将在360秒后停止脚本并显示500 Internal server error.我也更改了max_execution_time和memory_limit以及所有其他参数.但是没有将完整的数据导入数据库.有人可以帮忙吗?
I am working on csv file upload. It is working fine for 3MB file. But when i am trying to upload 8MB file.It stops the script after 360 sec and shows 500 Internal server error. I had changed max_execution_time and memory_limit and all other paramaters also.But not importing the complete data into database. Can anyone help?
推荐答案
查看.ini文件中的"post_max_size"
和"upload_max_size"
.您可能还需要通过"max_input_time"
和"max_execution_time"
来延长脚本的执行时间.
look at "post_max_size"
and "upload_max_size"
in your .ini file. You'll also likely need to extend the execution time of the script, via "max_input_time"
and "max_execution_time"
.
ini_set('upload_max_filesize', '10M');
ini_set('post_max_size', '10M');
ini_set('max_input_time', 300);
ini_set('max_execution_time', 300);
.htaccess方式
php_value upload_max_filesize 10M
php_value post_max_size 10M
php_value max_input_time 300
php_value max_execution_time 300
这篇关于PHP脚本在360秒后停止,并显示500个大型文件的服务器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!