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

From: Date: Wed, 04 Jun 2003 15:20:53 +0000
Subject: Re: Best method to detect Apache, IIS, or CLI?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-150198@lists.php.net to get a copy of this message
That are Apache Variables, in IIS the variables are diferent. So i don't believe that answer the question. "Chris Hayes" <chayes@antenna.nl> escribió en el mensaje news:5.2.0.9.0.20030604171751.02037a70@pop4.antenna.nl... > 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 (#150198) next »