Home  >  Article  >  Backend Development  >  How to modify PHP+Apache upload file size limit

How to modify PHP+Apache upload file size limit

WBOY
WBOYOriginal
2016-07-25 08:54:491084browse
How to modify the upload file size limit in php and apache? That is, a method to modify the restrictions when uploading PHP files. Friends in need can refer to it.

During the program migration process, it was found that files larger than 2m cannot be uploaded. First check the Localsetting.php file. This is the configuration file, which includes: $wgUploadSizeWarning = 20000000; field, but soon discovered that this was just a warning message.

If you choose to ignore all messages in the wiki, the file still cannot exceed 2M.

Continue to investigate and find that it is caused by PHP limiting the file upload size.

For the specific configuration file, see /usr/local/php/lib/php.ini.

Note that since the original rpm packages such as php and apache were uninstalled and installed manually through the source code, the configuration files in the /etc directory are actually invalid.

After the final modification of php.ini, you need to restart the apache service, /usr/share/apache/bin/apachetcl restart, and there will be no problem in uploading the file again.



Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn