Jump to content

best method to identify php environment


dsdsdsdsd

Recommended Posts

hello;

 

I have installed php on my personal computer ( winxp with apache );

 

so now all of my scripts will have two lives: one internet-based webserver life/domain AND a new local-machine-based life/domain;

 

consequently, my method calls such as  mysql_connect(...)  will need to either be hardcoded to identify the running environment ( for testing locally or for running live )  OR they can dynamically determine their environment and take appropriate actions;

 

I am aware of the $_SERVER array, but I understand that it is not necessarily consistent with the info it offers;

maybe one of the $_SERVER properties such as SERVER_NAME  or HTTP_HOST is an acceptable property(??)

 

 

any thoughts;

 

 

thanks

dsdsdsdsd

 

 

Link to comment
https://forums.phpfreaks.com/topic/94214-best-method-to-identify-php-environment/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.