There must be a more elegant answer
Does anyone know an elegant way to test, within a PHP script, if PHP is running as a CGI or as an Apache module?
Now Playing: She Wants To Play Hearts from Demolition by Ryan Adams
« It's November, which means... | Main | Not the help you were looking for »
Does anyone know an elegant way to test, within a PHP script, if PHP is running as a CGI or as an Apache module?
Now Playing: She Wants To Play Hearts from Demolition by Ryan Adams
Comments
phpsapiname() returns a lowercase string which describes the type of interface between web server and PHP (Server API, SAPI). In CGI PHP, this string is “cgi”, in mod_php for Apache, this string is “apache” and so on.
Posted by: Claudex | November 12, 2005 12:04 AM
Posted by: pjm | November 12, 2005 4:49 PM