Académique Documents
Professionnel Documents
Culture Documents
Add the below to the relevant php.ini file (recommended, if you have access). Note that
for some hosts this is a system-wide setting. However, for hosts running PHP as a CGI
script with suexec (for example) you may be able to put these directives in a php.ini file
in your Drupal root directory.
o upload_max_filesize = 10M
o post_max_size = 10M
Add the below to your .htaccess file in your Drupal root directory.
o php_value upload_max_filesize 10M
o php_value post_max_size 10M
The PHP documentation states that the memory_limit setting also affects file uploading.
Generally speaking, memory_limit should be larger than post_max_size. If this is an issue, see
the page on how to Increase memory available to PHP (3 methods)
Drupal also allows/enforces its own size limits, independently of what PHP allows. These are
found in Drupal 6 at "Administer Site configuration File uploads" ( /admin/settings/uploads ).
In Drupal 7 size limit is controlled on per-field basis. The Drupal settings cannot be larger than
those permitted by PHP, but may be smaller if you haven't updated them, so remember to check
there also, after updating the php.ini.
Skip to content
EasyEngine
WordPress on Nginx made easy!
Install
Docs
Community
EasyExperts
Blog
Contact
Careers
Search For :
This means, you need to increase PHP file-upload size limit. Following steps given below will
help you troubleshoot this!
Changes in php.ini
Edit
vim /etc/php5/fpm/php.ini
Set
upload_max_filesize = 100M
post_max_size = 100M
Notes:
You may like to read these posts which explains PHP file upload related config in some details.
http {
#...
client_max_body_size 100m;
#...
}
Note: For very large files, you may need to change value of client_body_timeout parameter.
Default is 60s.
Changes in WordPress-Multisite
If you are running WordPress Multisite setup, then you may need to make one more change at
the WordPress end.
Go to: Network Admin Dashboard >> Settings. Look for Upload Settings
You may need to change PHP max execution time limit also.
More optimization tips for WordPress-Nginx setup
Share this:
Facebook5
Twitter
Google
Reddit
Pocket
Email
Print
That final line was the one I needed, no other articles mention it. This should be the top
result in Google. Cheers!
2. Mike says:
Hey Im having this same issue and I cant figure it out to save my self I want to be able
to upload files up to 300mb but my server doesnt let me. Please help.
1. Rahul Bansal says:
Apart from steps mentioned in above article, you may need to change
memory_limit in php.ini file.
Better would be to check error logs. You will see exact reason why 300MB files
are not uploading properly. It might be the case that they are getting uploaded but
are failing to process.
Thanks for the tips on how to increase file limit on nginx server. At first I edited php.ini
file but it didnt work properly. After checking your tips I just edited nginx.conf file and
now its working perfectly.
Thanks!
There are few more things where PHP & Nginx both need changes. Coming from
Apache background, most of the time its hard to anticipate! I had spent hours
myself when I was new to nginx to find out this.
the multisite config had slipped my attention many thanks very helpful!
5. Kyle says:
I just HAD to leave a comment to say how much this helped me. Ive been scouring the
web for a solution to my 413 error and just knew it had something to do with nginx.
Much appreciated.
Works beautifully. Thanks for the concise and easy-to-understand instructions for a nginx
novice like me.
@David
@David
Thanks for appreciation. I hope you will find other tutorials in this series useful as
well.
8. Robson says:
9. sam says:
Nginx config
client_max_body_size 100m;
I just comment to say thank you Rahul..it save me lot of hours finding solution in the
web.your solution is easy to follow and concise nothing i find in google like
yours,everyone is just copy cat with other website lol!.again thank so much for your time
and effort.peace!
Table of Contents
o Changes in php.ini
Notes:
o Change in Nginx config
Reload PHP-FPM & Nginx
o Changes in WordPress-Multisite
o More
o Share this:
EasyEngine
Install
Community Support (Free)
Documentation
Commands
Troubleshooting
Tutorials
About Us
Contact
Blog
FAQs
We are Hiring
DevOps Engineer
Blog
Terms of Service