更新时间:2023-11-25 10:57:34
我不确定您使用的是哪种操作系统或使用的PHP版本.我使用PHP-FPM从Amazon Web Services运行Ubuntu 12.04实例.但是,说明应该基本上与您相同.在第3项中,保存php.ini文件的目录可能略有不同.
I'm not sure what operating system you are using or what version of PHP you are using. I run an Ubuntu 12.04 instance from Amazon Web Services using PHP-FPM. But, the instructions should be basically the same for you. The directory where your php.ini file is saved may be slightly different in item 3. Go hunt for it.
sudo /bin/bash
nano /etc/php5/fpm/php.ini
upload_max_filesize = 2M
的行.在nano中,您可以通过按Ctrl W进行搜索.upload_max_filesize = 200M
或=1G
). sudo /bin/bash
nano /etc/php5/fpm/php.ini
upload_max_filesize = 2M
. In nano, you can search by typing Ctrl W. upload_max_filesize = 200M
or =1G
). 目标是您需要的最低数量,并请记住,PHP在其他地方有另一个设置,用于设置超时之前等待的时间.您可以设置2G的上传限制,但是如果您的超时时间是30秒,那么除非您可以在30秒内上传2G,否则您仍然会失败.通常,要低一点.
Aim for the lowest number that you NEED, and keep in mind that PHP has another setting elsewhere that sets how long it will wait before a timeout. You can set a 2G upload limit, but if your timeout is 30 seconds you're still going to fail unless you can upload 2G in 30 seconds. As a general rule, aim low.
service php5-fpm restart
service php5-fpm restart