I am debugging a expensive website that perform a request for an php file named upload.php to upload some images towards the server.

The issue i am getting that debugging it with Firebug the request to that particular page is tossing a 406 Not Acceptable status code and isn't saving the pictures.

Publish Data:

alt text

This site runs well around the staging server however in production server this method from the image upload fails. I only can think that a big change to apache configuration / php should be done, however i have no clue how to proceed.

upload.php code:

alt text

Any help or guidance is going to be welcome, thanks ahead of time for that help.

att Sherlack

A 406 Not Acceptable error means the server really wants to send an answer which sort isn't indexed by the accept headers sent through the client (within this situation, Expensive) it's unrelated for your files neglecting to upload.

Your code looks fine, so this can be an problem together with your PHP configuration. Make certain upload_max_filesize and post_max_size is set up adequately inside your php.ini file.

Additionally towards the other solutions (publish_max_size it most likely is, hence my question for that image size), this blog entry outlines a far more uncommon reason behind a 406 in conjuction having a Expensive file upload, apparently triggered by mod_security.

This is probably an issue with your publish_max_size.

In php.ini alter the following to some number that suits your need:

memory_limit = 0M
post_max_size = 0M
upload_max_filesize = 0M

If this doesn't work then you will have to perform a similar alternation in your .htaccess file in Apache.

The issue was using the Suhosin PHP solidifying module. A few of the variable value length limits had been exceeded. The file which was edited was /etc/php.d/suhosin.ini also it logs to /var/log/.

Following the file was edited by my hosting administrator the issue was resolved.

Thanks all for the support!