admin管理员组

文章数量:1122832

Hi I am a beginner at WordPress and am currently trying to increase my file upload size.

So far I've tried two ways:

The first way was to add this to the bottom of the functions.php file:

@ini_set( 'upload_max_filesize' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );

That didn't seem to work.

The second way I tried was to install the PHP Settings plugin and add this to the file

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

However, when I try to verify that my change updated by clicking on Media > Add New, I still see 8MB as the max file size:

How would I do this? I'm trying to upload a theme that's 8MB+ and it won't work because of this limitation.

P.S. I'm using MAMP to start my server.

Hi I am a beginner at WordPress and am currently trying to increase my file upload size.

So far I've tried two ways:

The first way was to add this to the bottom of the functions.php file:

@ini_set( 'upload_max_filesize' , '64M' );
@ini_set( 'post_max_size', '64M');
@ini_set( 'max_execution_time', '300' );

That didn't seem to work.

The second way I tried was to install the PHP Settings plugin and add this to the file

upload_max_filesize = 64M
post_max_size = 64M
max_execution_time = 300

However, when I try to verify that my change updated by clicking on Media > Add New, I still see 8MB as the max file size:

How would I do this? I'm trying to upload a theme that's 8MB+ and it won't work because of this limitation.

P.S. I'm using MAMP to start my server.

Share Improve this question asked Nov 30, 2018 at 21:36 bigpotatobigpotato 3352 gold badges6 silver badges16 bronze badges 1
  • 2 If you have access to the php.ini file on the server, you would set max_upload_size there (and restart the apache process). Otherwise, you should be able to create an .htaccess file in the root of your wordpress site, and add php_value upload_max_filesize 30M – JakeParis Commented Nov 30, 2018 at 21:42
Add a comment  | 

1 Answer 1

Reset to default 1

1] To do this, change the upload_max_filesize and post_max_size directives in your php.ini file. To ensure that file uploads work correctly, the post_max_size directive should be a little larger than the upload_max_filesize. For example, the following settings demonstrate how to set a file upload limit to 20 megabytes:

upload_max_filesize = 20M
post_max_size = 21M

2] You need to add the following codes at the bottom of the .htaccess file:

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

ref links: https://kinsta.com/blog/wordpress-maximum-upload-file-size/ https://kinsta.com/blog/wordpress-maximum-upload-file-size/

本文标签: functionsMax file size not updating