phpcms上传错误413,其原因nginx默认限制最大上传文件就是1m,所以上传文件超过1m就会报413错误,解决方法:找到“nginx.conf”配置下的“client_max_body_size”,更改为10m即可。
apache服务器解决方法
修改下apache配置文件中的limitrequestbody配置,如果是虚拟主机,请联系空间商帮助修改。
具体步骤:
在apache环境中上传较大软件的时候,有时候会出现413错误,出现这个错误的原因,是因为apache的配置不当造成的,找到apache的配置文件目录也就是conf目录,和这个目录平行的一个目录叫conf.d打开这个conf.d,里面有一个php.conf
目录内容如下:
## php is an html-embedded scripting language which attempts to make it# easy for developers to write dynamically generated webpages.#loadmodule php4_module modules/libphp4.so## cause the php interpreter handle files with a .php extension.#setoutputfilter phpsetinputfilter phplimitrequestbody 6550000## add index.php to the list of files that will be served as directory# indexes.#directoryindex index.php
错误就发生在这个limitrequestbody配置上,将这个的值改大到超过你的软件大小就可以了
如果没有这个配置文件请将
setoutputfilter phpsetinputfilter phplimitrequestbody 6550000
写到apache的配置文件里面即可。
推荐教程:《phpcms教程》
以上就是phpcms上传错误413?的详细内容。