PHP上传多个文件总是给我超时错误


PHP Uploading Multiple files always gives me timeout error

好的,我不太明白为什么,但无论我在PHP的ini_set函数中设置了什么,我都无法上传多个文件,或者我正在上传的文件太大。。。我不明白。以下是我目前在处理发布表单时上传的$_FILES[]数组的脚本中设置的内容:

// Try and allow for 3 hours, just in case...
@set_time_limit(10800);
// Try and set some ini settings to buy us some time...
@ini_set('memory_limit', '512M');
@ini_set('upload_max_filesize', '512M');
@ini_set('post_max_size', '550M');
@ini_set('session.gc_maxlifetime', '10800');  // Allows for up to 3 hours
@ini_set('max_input_time', '10800');  // Allows for up to 3 hours
@ini_set('max_execution_time', '10800'); // Allows for up to 3 hours

我正在使用move_uploaded_file将其放置到指定的目录中,不确定这是否重要?

老实说,我如何才能允许上传多个文件而不出现超时错误??如果我上传1个文件,似乎很好。不确定是多个文件的数量问题,还是合并后的文件太大?我试过使用大约15MB的总文件大小,这会产生超时错误!arggggg!!!!

我必须做些什么才能做到这一点??

如果您使用的是apache服务器,服务器本身也有时间限制。

查看apache配置中的TimeOut指令(默认为300秒)

你也可以查看apache错误日志

如果你只上传2个文件,每个文件1Kb,可以吗?

为了可靠地上传大文件+多个文件,您应该使用文件上传器

我更喜欢http://www.uploadify.com/对于这个