PHP仍然不会允许超过2 MB的文件上传文件上传、PHP、MB

2023-09-11 09:02:43 作者:雨落倾城〆夏未凉

我有一个Debian的挤压安装上运行的Apache2和PHP 5.3.3-7一个Amazon EC2实例。我想它能够接受一个标准的傻瓜相机(大约5 MB)上传。因此,我已经编辑在php.ini中的/ etc / PHP5 /的Apache2 /允许多达18MB的上传,我已经调升时PHP将允许工作的脚本。

尽管重新启动Apache和连机本身,它绝对拒绝上传任何文件超过2 MB的。这是一个EC2问题,或者是仍然是一个PHP的问题。我相当肯定,我熨平了它是PHP的一切可能性,但我一直在盯着同一个4行code的最后一个星期,并寻找像一个疯狂的人,这是什么可能可能是。

/etc/php5/apache2/php.ini:

 的max_execution_time = 120
...
max_input_time设置= 120
...
的upload_max_filesize = 18M
...
的post_max_size = 18M
 

我有双重检查刚才用的phpinfo(),这些设置都是有效的,但它仍然无法正常工作。

解决方案

检查设置的upload_max_filesize 的post_max_size 在你的的php.ini 文件

I have a Debian Squeeze install on an Amazon EC2 instance running Apache2, and PHP 5.3.3-7. I would like it to be able to accept uploads from a standard point-and-shoot camera (about 5 MB). Accordingly, I've edited php.ini in /etc/php5/apache2/ to allow for up to 18MB uploads, and I've upped the time PHP will allow to work on a script.

DoraBox靶场 四 文件上传

Despite restarting Apache and even the machine itself, it absolutely refuses to upload any file larger than 2 MB. Is this an EC2 problem or is it still a PHP issue. I'm fairly sure I've ironed out all possibility of it being PHP, but I've been staring at the same 4 lines of code for the last week and searching like a mad person for what this could possibly be.

/etc/php5/apache2/php.ini:

max_execution_time = 120
...
max_input_time = 120
...
upload_max_filesize = 18M
...
post_max_size = 18M

I have double checked just now with phpinfo(), these settings are in effect, but it still does not work.

解决方案

Check settings upload_max_filesize and post_max_size in your php.ini file