简体   繁体   中英

php upload maximum size file using php.ini file and .htaccess

upgrade upload_max_filesize

currently show 2M

i Want To 50M

php.ini code

upload_max_filesize=30M;

.htaccess file code

php_value upload_max_filesize 30M

but these file is not work

if i upload .htaccess file then show 500 server error .

please sol this problem thanks .

PHP has several configuration options to limit resources consumed by scripts. By default, PHP is set to allow uploads of files with a size of 2MB or less.

Try increasing the following values in php.ini, for example:

memory_limit = 32M
upload_max_filesize = 32M
post_max_size = 32M

If you want to set those values only for specific project then do it in .htaccess file otherwise set values in php.ini file

.htaccess file should be:-

php_value post_max_size 32M
php_value upload_max_filesize 32M

set the value of upload_max_filesize and post_max_size in your php.ini:

Maximum allowed size for uploaded files. upload_max_filesize = 50M

Must be greater than or equal to upload_max_filesize post_max_size = 50M

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM