PHP脚本在360秒后停止,并显示500个大型文件的服务器错误 [英] php script stops after 360 seconds and shows 500 server error for large files

查看:74
本文介绍了PHP脚本在360秒后停止,并显示500个大型文件的服务器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在处理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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆