PHP: Having trouble uploading large files(PHP:上传大文件时遇到问题)
问题描述
我正在使用 PHP 上传文件,这对于我的本地主机上大小为 2.8MB 的文件工作正常 - 但不适用于我的 Mediatemple GS 主机.小于 2MB 的文件可以正常工作,但任何更大的文件似乎都不起作用...我没有收到任何错误消息但是当上传完成时,在上传目录中找不到该文件...
I am doing a file upload using PHP, which works fine for a file of size 2.8MB on my localhost - but not my Mediatemple GS host. Files smaller than 2MB work fine, but anything larger seems to not work... I am not getting any error message but when the upload finishes, the file is not found in the uploads directory...
我用谷歌搜索了一下,然后在 .htaccess 文件中添加了以下几行:
I googled around, and I added the following lines to the .htaccess file:
php_value memory_limit 120M
php_value max_execution_time 120
php_value upload_max_filesize 10G
php_value post_max_size 10G
我知道上面的一些值有点矫枉过正,但即便如此,这似乎也无济于事......我可能还缺少什么?
I know some of the above values are a overkill, but even then, this does not seem to help... Anything else I might be missing?
推荐答案
你错过的是 max_input_time,并检查您的编辑是否反映在 phpinfo(); 中.
The one you missed is max_input_time, and do check whether your edits are reflected in phpinfo();.
这篇关于PHP:上传大文件时遇到问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:PHP:上传大文件时遇到问题
基础教程推荐
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- PHP 类:全局变量作为类中的属性 2021-01-01
- 如何替换eregi() 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
