# File upload with php-fpm

**URL:** <https://www.ruby-forum.com/t/file-upload-with-php-fpm/228710>\
**Category:** NGINX\
**Created:** [May 4, 2013, 4:54pm UTC](https://www.ruby-forum.com/t/file-upload-with-php-fpm/228710 "2013-05-04T16:54:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![nateless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@nateless](https://www.ruby-forum.com/u/nateless)\
**Post date:** [May 4, 2013, 4:54pm UTC](https://www.ruby-forum.com/t/file-upload-with-php-fpm/228710/1 "2013-05-04T16:54:56Z")

</div>

Hello,

I’ve a problem with file upload and googling and checking with  
everything  
didn’t help to solve it.

The problem is when file is being uploaded larger than few megs browser  
repeats request after about 30 seconds, and on the second request after  
another 30-40s it throws connection reset and nginx has 408 error on  
that  
post request, no other errors in nginx nor in php.

related settings to fiel upload are:

```
client_body_buffer_size 1m;
client_header_buffer_size 128k;
client_max_body_size 1000m;

client_body_timeout 500;
client_header_timeout 500;
keepalive_timeout 500 500;
send_timeout 500;

keepalive_requests 100;
tcp_nodelay on;
reset_timedout_connection on;

```

server works with php (php-fpm) with socket. standart configuration.

Posted at Nginx Forum:

> **[file upload with php-fpm](https://forum.nginx.org/read.php?2,238838,238838#msg-238838)**
>
> Hello, I've a problem with file upload and googling and checking with everything didn't help to solve it. The problem is when file is being uploaded larger than few megs browser repeats request after about 30 seconds, and on the second request after...

---

<div class="post-metadata">

**Author:** ![nateless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@nateless](https://www.ruby-forum.com/u/nateless)\
**Post date:** [May 4, 2013, 9:54pm UTC](https://www.ruby-forum.com/t/file-upload-with-php-fpm/228710/2 "2013-05-04T21:54:37Z")

</div>

hi.

nginx.conf:  
client\_max\_body\_size 42m;

php.ini:  
memory\_limit = 64M  
post\_max\_size = 40M  
upload\_max\_filesize = 32M

it works fine for me with that settings. I havent speficied any timeout  
settings you used.  
Have you edited php.ini for php-fpm? If not - default upload file size  
is 2M

Posted at Nginx Forum:

> **[Re: file upload with php-fpm](https://forum.nginx.org/read.php?2,238838,238840#msg-238840)**
>
> Hello, I've a problem with file upload and googling and checking with everything didn't help to solve it. The problem is when file is being uploaded larger than few megs browser repeats request after about 30 seconds, and on the second request after...

---

<div class="post-metadata">

**Author:** ![nateless](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@nateless](https://www.ruby-forum.com/u/nateless)\
**Post date:** [May 4, 2013, 10:50pm UTC](https://www.ruby-forum.com/t/file-upload-with-php-fpm/228710/3 "2013-05-04T22:50:07Z")

</div>

Of course I set correct php settings settings:

memory\_limit =\> 512M  
post\_max\_size =\> 1000M  
upload\_max\_filesize =\> 1000M

Posted at Nginx Forum:

> **[Re: file upload with php-fpm](https://forum.nginx.org/read.php?2,238838,238841#msg-238841)**
>
> Hello, I've a problem with file upload and googling and checking with everything didn't help to solve it. The problem is when file is being uploaded larger than few megs browser repeats request after about 30 seconds, and on the second request after...
