今天晚上特意测试了这个问题
观察apache错误日志:
#cat /var/log/apache2/error.log
[Wed Apr 25 10:31:32.269028 2018] [:error] [pid 3161] [client 120.229.113.xx:65035] PHP Warning: POST Content-Length of 9286197 bytes exceeds the limit of 8388608 bytes in Unknown on line 0, referer: https://whycan.cn/upfiles.php
[Wed Apr 25 10:34:49.411261 2018] [:error] [pid 3182] [client 120.229.113.xx:65170] PHP Warning: POST Content-Length of 9286197 bytes exceeds the limit of 8388608 bytes in Unknown on line 0, referer: https://whycan.cn/upfiles.php
离线
root@localhost:/etc/php5# grep 8M -r /etc/php5
./apache2/php.ini:; Maximum amount of memory a script may consume (128MB)
./apache2/php.ini:memory_limit = 128M
./apache2/php.ini:post_max_size = 8M
./cli/php.ini:; Maximum amount of memory a script may consume (128MB)
./cli/php.ini:post_max_size = 8M
找到上面8M的地方, 都改成32M
再执行
#sudo service apache2 restart
上传文件的限制立马解决!
离线