I have a staging server and a live server, and I run the same code base on both... there's some directives in the PHP to change paths, etc, if it's running on staging. But for that to work, the PHP Script has to be able to ID the machine it's on. (I prefer this to setting a flag every time I want to move the code from staging to live.)
I tried using "if(stristr($_SERVER['HTTP
_HOST'], 'localhost'))" which works (since my local apache that I use for testing is just http://localhost
)... except I run it on a couple of different staging servers that both resolve as localhost.
Is there some minor Apache option I could set, that would be retrievable in PHP?
(I say minor, since I could probably change 'localhost' to something more machine-specific, but I'd prefer not to. Ideally, it'd be some kind of minor PHP flag I could set in the httpd.conf file, then PHP could just check that.)