Re: Unix vs PC test for server
| From: | Alexander Wagner | Date: | Thu, 16 Aug 2001 14:59:19 +0000 |
| Subject: | Re: Unix vs PC test for server | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-63030@lists.php.net to get a copy of this message | ||
Paul S. wrote:
> I design a website on a PC, and upload it to UNIX. Of course, there
> are always one or two variables that I have to keep track of as to
> whetherteh server is UNIX or PC. There MUST be a simple way to test
Just do a phpinfo(). There should be an environment-variable you should
be able to use. The safest way to retrieve them ist getenv().
getenv('SAPI') perhaps?
> if (the OS is Windows) {
> $siteurl = "http:// www.website.com/ ";
> $mysqlpasswordfilelocation = " ... outsideroot.txt ";
> }else{
> $siteurl = "http://127.0.0.1/";
> $mysqlpasswordfilelocation = " ...outsideroot.txt ";
> }
You could also use a config-file. This way, you could run your scripts
on more than two sites.
regards
Wagner
PS: My PC is running UNIX.
--
Madness takes its toll. Please have exact change.