简体   繁体   中英

How to increase maximum upload file size in WordPress using .htaccess

How to increase maximum upload file size in WordPress using .htaccess?

Been trying to increase the max upload file size in WordPress. Tried changing php in cPanel but couldn't get that to work. Tried typing this code into the .htaccess editor plugin:

php_value upload_max_filesize 128M
php_value post_max_size 128M
php_value memory_limit 256M
php_value max_execution_time 300
php_value max_input_time 300

but it keeps telling me syntax error. I'm placing it after the #END WordPress line too.

You can also use ini_set in wp_config.php

ini_set('upload_max_filesize', '128M');
ini_set(' post_max_size', '128M');
.htaccess
php_value upload_max_filesize 64M
php_value post_max_size 128M
php_value memory_limit 256M
php_value max_execution_time 300
php_value max_input_time 300

Functions.php
@ini_set( 'upload_max_size' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );

php.ini put on root directory where your .htaccess located
upload_max_filesize = 25M
post_max_size = 13M
memory_limit = 15M

wp-config.php
@ini_set( 'upload_max_size' , '20M' );
@ini_set( 'post_max_size', '13M');
@ini_set( 'memory_limit', '15M' );

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