# Nginx got an 500 error when uploading files

**URL:** <https://www.ruby-forum.com/t/nginx-got-an-500-error-when-uploading-files/235016>\
**Category:** NGINX\
**Created:** [May 26, 2013, 6:04am UTC](https://www.ruby-forum.com/t/nginx-got-an-500-error-when-uploading-files/235016 "2013-05-26T06:04:52Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![alcina](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/a587f6/32.png) [@alcina](https://www.ruby-forum.com/u/alcina)\
**Post date:** [May 26, 2013, 6:04am UTC](https://www.ruby-forum.com/t/nginx-got-an-500-error-when-uploading-files/235016/1 "2013-05-26T06:04:52Z")

</div>

Hi everyone,

I am using nginx 1.4.1 and php-fpm 5.3.25.

Everything is fine except when I uploading files to server.

I have a Discuz! x3(a forum system) and when I post threads, except  
attachment everything is fine, but when I add a small files(such as 30k  
rar,jpg or else), nginx give me a 500 error.

I checked the nginx/site error, but have no usefule information. nginx  
only  
tell me a got an 500 error, but didn’t tell me why.

I tried to increase the fast\_cgi parama:

fastcgi\_connect\_timeout 300;  
fastcgi\_send\_timeout 300;  
fastcgi\_read\_timeout 300;  
fastcgi\_buffer\_size 1024k;  
fastcgi\_buffers 32 64k;  
fastcgi\_busy\_buffers\_size 1500k;  
fastcgi\_temp\_file\_write\_size 1800k;

But still the same.

So, please help me for solve this problem, I wonder where can I got the  
error message?

Thank you.

---

<div class="post-metadata">

**Author:** ![baalchina](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/ec9cab/32.png) [@baalchina](https://www.ruby-forum.com/u/baalchina)\
**Post date:** [May 27, 2013, 2:12pm UTC](https://www.ruby-forum.com/t/nginx-got-an-500-error-when-uploading-files/235016/2 "2013-05-27T14:12:09Z")

</div>

Hello!

On Sun, May 26, 2013 at 12:03:58PM +0800, baalchina wrote:

> I checked the nginx/site error, but have no usefule information. nginx only  
> fastcgi\_temp\_file\_write\_size 1800k;
> 
> But still the same.
> 
> So, please help me for solve this problem, I wonder where can I got the  
> error message?

If the 500 is returned by nginx, there should be an explanation in  
error log.

If there is nothing in error log - this suggests the 500 response  
is generated by php, and you have to dig into the php code to see  
what happens there.

–  
Maxim D.

> **[nginx: donation](http://nginx.org/en/donation.html)**
