How can I increase max file upload in Wordpress?

2019-05-17 16:50发布

I set in php.ini

upload_max_filesize = 64M
post_max_size = 64M

Then try .htaccess file

php_value  upload_max_filesize  64M
php_value  post_max_size  64M

And in wp-config.php define('WP_MEMORY_LIMIT', '64M'); But nothing helps me. The max upload size left 32px;

How can I increase max file upload in Wordpress?

标签: wordpress
3条回答
别忘想泡老子
2楼-- · 2019-05-17 17:18

You can try in PHP :

ini_set('post_max_size', 100000); // 10Mo
ini_set('upload_max_filesize', 100000);

But be careful, with some of server supplier you cannot change this limit...

查看更多
Lonely孤独者°
3楼-- · 2019-05-17 17:23

Earlier adding define('WP_MEMORY_LIMIT', '64M'); just after <?php on wp-config.php always worked for me. For the latest wordpress version it isn't working. I don't know the actual reason behind it but it still works for my older wordpress sites which I never updated from last year.

Follow these steps for latest Wordpress:

1) Put this at the end of your php.ini

upload_max_filesize = 512M
post_max_size = 512M
max_execution_time = 300

2) Restart apache(Setting won't take effect until apache is restarted)

Tested and working.

I tried both .htaccess and and php.ini on wp-admin methods as well, They aren't working either.

查看更多
我欲成王,谁敢阻挡
4楼-- · 2019-05-17 17:26

I tried different way like attempted to

1. change my limit directly on my server
2. through the .htaccess file 
3. wp-config.php 

but none of these changes worked for me. Then I came across a post somewhere That I summarised in a blog post(find below)

All you need to do is 
1. create a php.ini 
2. upload to admin directory

here is a link if you want to know more http://ecarobar.com/increase-max-upload-file-size-in-wordpress/

查看更多
登录 后发表回答