When moving to Nginx with multiple php-fpm servers from a more "traditional" Varnish + multiple Apache2 / mod_php setup:

Must we expect to rewrite parts of our software? I just discovered that many of the apache_* functions now work without Apache (as of PHP 5.4).

Do apps have the same $GLOBALS, $_GET, $_POST, $_FILES variables? How about $_SERVER['REQUEST_URI'] etc?

Anything else at all that we should look out for?

2 Answers 2


PHP running under Nginx should have the same global variables as when running under Apache.

Here is a report of somebody who tested it. They initially thought that some were missing, but found out that PHP only creates them as they are used in some cases.


Your PHP code will not need to be same as PHP will populate the superglobals you are interested in based on PHP's link to the web server software. The underlying technology should be of minimal consequence to your coding except where the difference is between Linux and Windows as there are some minor differences to file access functions and some PHP extensions which are only available on one OS but not the other.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.