Mobile app version of vmapp.org
Login or Join
Pope3001725

: 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

@Pope3001725

Posted in: #LoadBalance #Nginx #Php

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?

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Pope3001725

2 Comments

Sorted by latest first Latest Oldest Best

 

@Si4351233

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.

10% popularity Vote Up Vote Down


 

@Eichhorn148

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme