PHP 脚本仅在大文件上传时挂起

发布于 2024-12-12 04:42:29 字数 517 浏览 0 评论 0原文

我有一个 php 脚本,允许用户在 POST 上将多个文件上传到服务器,然后重定向到下一页。

它似乎已经工作了一段时间,但最近用户报告它无限挂起。他们输入所有字段,选择要上传的文件,点击发布,然后等待几个小时,然后放弃并关闭窗口。但当我检查时,文件似乎已成功上传并且完好无损。只是字段没有发布。

脚本似乎无法转换到下一部分,其中表单字段被解析并插入到 mysql 数据库中。我做了一些小测试,但无法重现问题。虽然我没有时间去测试200M这样的大文件。

任何用户上传的最大总文件大小为 200M,所以我觉得我的 php 核心设置足够了。这就是我所拥有的:

max_execution_time = 7200
max_file_uploads = 20
max_input_time = 7200
memory_limit = 8000M
output_buffering = 4096
upload_max_filesize = 500M 

核心设置中的其他内容可能会给我带来这个问题吗?还是浏览器的问题?

I have a php script that allows users to upload multiple files to server on POST, then redirect to next page.

It seems to have been working for some time but lately users are reporting it hanging infinitely. They input all fields, select files to upload, hit post, then wait for hours then give up and close the window. But when I check it appears the files were successfully uploaded and in tact. Just the fields were not posted.

It seems the script cannot transition to the next section where form fields get parsed and inserted to mysql database. I've did some small tests and cannot recreate the problem. Although I don't have the time to test with large files such as 200M.

The max total filesize any user would upload would be 200M so I feel my php core settings are sufficient. Here is what I have:

max_execution_time = 7200
max_file_uploads = 20
max_input_time = 7200
memory_limit = 8000M
output_buffering = 4096
upload_max_filesize = 500M 

Anything else in the core settings that could perhaps be giving me this problem? Or would it be a browser problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

老街孤人 2024-12-19 04:42:29

这很可能是您用户的连接速度。询问您的一位用户的连接速度,并使用 Google Chrome 并查看状态栏,它应该会增加上传进度的百分比。或者我建议您自己尝试一下并限制某人的带宽。请记住,您的用户很可能最多拥有 1.5 up,除非他们有 Fios 或更好的连接(例如 T1)。

This is most likely your users' connection speed. Ask one of your users their connection speed and to use Google Chrome and look at the status bar, it should increment the percentage of the progress of the upload. Or I recommend trying this yourself and throttling your bandwidth someone. Remember your users most likely have a maximum of 1.5 up unless they have Fios or a better connection (e.g. T1).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文