I installed nginx on Ubuntu Hardy and immediately realized that the PHP scripts were getting empty request arrays, ie whether GET or POST nothing was coming through, even the $_REQUEST array was empty.
When I switch back to Apache it was all fine.
The installation nginx version is 0.6.35-0ubuntu1.1~hardy1 and PHP is PHP Version 5.2.4-2ubuntu5.10.
What could be wrong?
Check if this set in your "location"-section for your fastcgi-module
http://wiki.nginx.org/NginxHttpFcgiModule
It's a feature of the
try_files command
in nginx that thequery_string
is not passed automatically to the rewritten file but instead must be passed explicitly. Because of this_$SERVER['QUERY_STRING']
is always empty, and so the the variables$_REQUEST
and$_GET
are also not set.From the Nginx documentation:
or with just the arguments
If you want to guarantee to get the original arguments then use
$query_string
which is the same as$args
except that$query_string
is read-only.Try to check the variables_order in php config file used by nginx.
It can happen if Apache has
LimitRequestBody
(see core) orSecRequestBodyLimit
(see mod_security) set and the request body is larger than said limit.