Definitive matrix of $_SERVER values for different web server software out there? [closed]
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 5 years ago.
Improve this questionI'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...
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.
精彩评论