dsdsdsdsd Posted March 4, 2008 Share Posted March 4, 2008 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 More sharing options...
Stooney Posted March 4, 2008 Share Posted March 4, 2008 I think it's best you include a file from above the webroot that makes your database connection. Your live and local server will each have it's own version of this. Link to comment https://forums.phpfreaks.com/topic/94214-best-method-to-identify-php-environment/#findComment-482604 Share on other sites More sharing options...
dsdsdsdsd Posted March 4, 2008 Author Share Posted March 4, 2008 Chris, thanks; dsdsdsdsd Link to comment https://forums.phpfreaks.com/topic/94214-best-method-to-identify-php-environment/#findComment-483074 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.