Getting file upload problem, is this an nginx problem?

I’m getting error the following message when uploading a file on Drupal.
“An unrecoverable error occurred. The uploaded file likely exceeded the
maximum file size (2 MB) that this server supports.”

the files I am uploading are within the maximum size so I decided to
look into the error logs to see what was being generated.

FastCGI sent in stderr: "PHP Notice: Undefined index: SCRIPT_NAME in
bootstrap.inc on line 250

PHP Notice: Undefined index: REMOTE_ADDR in bootstrap.inc on line 1193"
while reading response header from upstream,
client: 222.222.22.222, #My IP is displayed here
server: domain.com,
request: “POST /filefield/ahah/story/field_node_images/0 HTTP/1.1”,
upstream: “fastcgi://127.0.0.1:9000”,
host: “domain.com”,
referrer: “http://domain.com/node/add/story

I am not sure what to make of this and would be grateful if someone
could point me in the right direction.

Extra bit of info - my local site runs fine but I believe this is a
problem with my live server set up.

Live server is running:
nginx 0.7.61
php 5.3 with php-fpm

Clean url is working fine.

Is this a php 5.3 or a nginx vhost rewrite problem perhaps?

Posted at Nginx Forum:

2009/11/3 mojipittan [email protected]:

[…]
Is this a php 5.3 or a nginx vhost rewrite problem perhaps?

it could be both nginx and php issue. Check upload_max_size and
post_max_size in php and client_max_body_size in nginx (default 1mb)
for the start. But… if Drupal report you that max file size that you
can upload is 2mb, I thing is php issue.

Best Regards
Grzegorz
Sieñko

Thanks for the suggestion Grzegorz.

I’ve experimented with changing the php.ini and nginx setting like you
mentioned.

upload_max_size was turned up to 4 mb
post_max_size was set to 8mb

I restarted the PHP-fpm and nginx server and got the same message but
with the updated value “An unrecoverable error occurred. The uploaded
file likely exceeded the maximum file size (4 MB) that this server
supports.”

nginx setting client_max_body_size seems to have no effe t either.

I think I have address the “Undefined index” situation, do you have any
clues?

Thanks!

Jonny

Posted at Nginx Forum:

Hello Jonny, I was wondering if you ever found a solution to this? I
seem to have encountered the same problem in my setup.

Posted at Nginx Forum:

I don’t know if this will help, if you had the same problem with drupal
then I what I have to say next will make sense, if not then it will
likely be another problem.

this error came up for me because I was using php 5.3 rather than 5.2
—> Drupal is supposed to be okay with 5.3 now but there are a number
of modules that Drupal requires that have not been updated to work on
5.3 yet, so you will get all sorts of errors popping up.

what I learnt from the whole experience was: new is not always better in
the world of Linux (unless you know what you are doing)

hope this helps
good luck!

Posted at Nginx Forum:

Thank you! I hope this works I’ve cleared my dev server and I’m
resetting things up from scratch so nothing old stays lingering around.

Posted at Nginx Forum: