Re: Test the server.
| From: | David Otton | Date: | Sat, 22 Mar 2003 18:13:03 +0000 |
| Subject: | Re: Test the server. | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-140701@lists.php.net to get a copy of this message | ||
On Sat, 22 Mar 2003 12:59:19 -0800, you wrote:
>Yes I know but my aim is to make a php script which checks automaticly
>if the php and the shell functions I need are available.
If you look at the output of phpinfo() you'll see a whole bunch of
variables that are set differently depending on the OS (eg
SERVER_SOFTWARE, SystemRoot, _SERVER), although personally I would set
the name of the current OS in a configuration file. Less room for error
that way.
To discover whether an application exists, use system() to call it and
check the return value provided by the OS. I think you'll find it
returns FALSE on failure.