# File upload to php under fastcgi

**URL:** <https://www.ruby-forum.com/t/file-upload-to-php-under-fastcgi/219548>\
**Category:** NGINX\
**Created:** [May 7, 2012, 10:56am UTC](https://www.ruby-forum.com/t/file-upload-to-php-under-fastcgi/219548 "2012-05-07T10:56:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [May 7, 2012, 10:56am UTC](https://www.ruby-forum.com/t/file-upload-to-php-under-fastcgi/219548/1 "2012-05-07T10:56:21Z")

</div>

Hi all,

My phpmyadmin file uploads are collapsing at about 1MB, although I have  
altered the php.ini params to allow 8MB file uploads.

I have searched for an nginx config param that would cause this, but  
have found nothing.

Is there one? If so what is it?

Thanks

Ian

–  
Ian H.  
31 Sheerwater, Northampton NN3 5HU,  
Tel: 01604 513875  
Preparing eBooks for Kindle and ePub formats to give the best reader  
experience.

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [May 7, 2012, 11:14am UTC](https://www.ruby-forum.com/t/file-upload-to-php-under-fastcgi/219548/2 "2012-05-07T11:14:59Z")

</div>

Hi,

It looks like you have to set `client_max_body_size` to a higher limit  
(e.g. “8M”). That should solve it. See  
[http://nginx.org/en/docs/http/ngx\_http\_core\_module.html#client\_max\_body\_size](http://nginx.org/en/docs/http/ngx_http_core_module.html#client_max_body_size)  
for documentation re. that parameter.

Regards,  
Christian

2012/5/7 Ian H. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [May 7, 2012, 11:19am UTC](https://www.ruby-forum.com/t/file-upload-to-php-under-fastcgi/219548/3 "2012-05-07T11:19:22Z")

</div>

Hi,

client\_max\_body\_size 50m; (50M as example)  
should fix the Problem.

Regards,  
Alex

Am 07.05.2012 10:55, schrieb Ian H.:

---

<div class="post-metadata">

**Author:** ![dcian](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/91b2a8/32.png) [@dcian](https://www.ruby-forum.com/u/dcian)\
**Post date:** [May 7, 2012, 12:49pm UTC](https://www.ruby-forum.com/t/file-upload-to-php-under-fastcgi/219548/4 "2012-05-07T12:49:13Z")

</div>

Thanks guys,

That param was set to 4m at the http level. I have raised it to 8m, so  
it should cope with a 6676kb file.

Regards

Ian

On 07/05/2012 10:14, Christian B. wrote:

> > 
> 
> * * *
> 
> No virus found in this message.  
> Checked by AVG - [www.avg.com](http://www.avg.com)  
> Version: 2012.0.2171 / Virus Database: 2425/4982 - Release Date: 05/06/12

–  
Ian H.  
31 Sheerwater, Northampton NN3 5HU,  
Tel: 01604 513875  
Preparing eBooks for Kindle and ePub formats to give the best reader  
experience.
