[英]Max upload size limit 2MB in php even after editting php.ini
I have v annoying pb that am struggling to resolve.我有一个烦人的 pb,正在努力解决。 Basically, when i was testing code on localhost it used to give error if i tried uploading image larger than 2M.
基本上,当我在本地主机上测试代码时,如果我尝试上传大于 2M 的图像,它通常会出错。 I have edited php.ini file as advised on other threads and that fixed the problem.
我已经按照其他线程的建议编辑了 php.ini 文件并解决了问题。 However, when i moved exactly same code to AWS EC2 instance, I am again getting same issue.
但是,当我将完全相同的代码移动到 AWS EC2 实例时,我再次遇到同样的问题。
if i check phpinfo(), that does correctly show如果我检查 phpinfo(),它会正确显示
post_max_size = 30M
upload_max_filesize = 30M
as i would like it to be.正如我希望的那样。 I have also restarted apache, httpd and pretty much anything i could think of for any changes to take into effect, but i am still having this issue.
我还重新启动了 apache、httpd 以及几乎所有我能想到的让任何更改生效的东西,但我仍然遇到这个问题。
Adding the following bits directly into the code:将以下位直接添加到代码中:
ini_set('upload_max_filesize', '30M');
Anyone could help with this please?有人可以帮忙吗? Thanks
谢谢
if you're using unix based system (linux) you may try to create a new file in your root directory(eg: var/www
or public_html
) with this name: .user.ini
(Exactly this name. Dot at the beginning is required).如果您使用的是基于 unix 的系统 (linux),您可以尝试在根目录中创建一个新文件(例如:
var/www
或public_html
),名称为: .user.ini
(正是这个名称。开头的点是必需的)。 Then try to set your values:然后尝试设置您的值:
post_max_size = 30M
upload_max_filesize = 30M
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.