: When moving a load balanced PHP site from Apache to Nginx, how does the code have to be modified? When moving to Nginx with multiple php-fpm servers from a more "traditional" Varnish + multiple
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?
More posts by @Pope3001725
2 Comments
Sorted by latest first Latest Oldest Best
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.
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.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.