本文环境为AzurePack WebSite
描述:
订阅windows azurepack website后,php默认为2MB
在PHP运行时 ( php.ini )中定义的默认设置为2 MB 。 由于我们不能编辑php.ini,我们需要在.user.ini中覆盖它
有2个PHP指令控制文件上传的限制。 它们是 upload_max_filesize 和post_max_size 。 两者都具有PHP_INI_PERDIR模式作为php.ini指令列表 。upload_max_filesize 2 MB和post_max_size的默认值为8 MB
解决方法:
notepad新建一个”.user.ini”,添加以下内容:
;Maximum size of the files that can be uploaded ;value of post_max_size must be larger than upload_max_filesize upload_max_filesize = 16M post_max_size = 22M
保存关闭,通过FTP上传”.user.ini”到Website网站的根目录
另外还需要新建一个”web.config”文件,添加如下:
<security> <requestFiltering> <requestLimits maxAllowedContentLength="1024000000"/> </requestFiltering> </security>
maxAllowedContentLength修改为自己需要的上传文件最大多少。重启下网站,再试下吧~~