Re: Best method to detect Apache, IIS, or CLI?

From: Date: Wed, 04 Jun 2003 15:19:02 +0000
Subject: Re: Best method to detect Apache, IIS, or CLI?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-150194@lists.php.net to get a copy of this message
dunno what's best, test on each server what values you can find in $_SERVER (PHP>=4.10), maybe $_SERVER["SERVER_SIGNATURE"] or $_SERVER["SERVER_SOFTWARE"] At 17:07 4-6-03, you wrote:
Hi, what is the best method to detect if a php script is started into Apache, IIS or in a CLI script? I've found several issues, but I am not sure to be right. * CLI: - PHP_SELF='-' - var $argv, $argc exist - constant STDIN, STDOUT, STDERR exist * http server: - PHP_SELF != '-' for ever - $argv, $argc not found (in my apache install) - constant STDIN, STDOUT, STDERR not exist, but they can be defined by someone else * But I don't know between Apache and IIS. Thanks Jean-Pierre


« previous php.general (#150194) next »