views:

21

answers:

1

I'm write PHP applications to distribute publicly, and am trying to ensure they run correctly on all popular web server software (IIS, Apache, NGINX, Lighttpd).

Does anybody know if someone has created definitive matrix of $_SERVER array items for each different popular server software package? Sounds like a good idea, and I just want to make sure that it hasn't been created already before I attempt to do so myself...

+1  A: 

Not exactly the answer you are looking for, but rather a suggestion.

I would personally for the new approach for sniffing for abilites of the server, rather than the server itself. jQuery has deprecated browser support in favor of feature support, and I consider that it is neat way to make sure your program/script works on all supported platforms.

For PHP applications specifically, problems arise when php is loaded either as a module, cgi or fastcgi extension. You can simply create helper functions for getting server/environment parameters, headers etc. That should provide maximum compatibility on different servers for your application.

Samnan
This is a very nice approach. If an essential value is missing, `die()` and throw an error message.
Pekka