freephoneid Posted August 4, 2008 Share Posted August 4, 2008 Hi, Currently my PHP code is not having environment specific property files. For e.g. a file called a.php is using production email address. So, when I deploy this file in my dev or staging environment, I've to update this file every time so that email will not be sent to actual production email id. Is there any way to make it environment specific? I'm thinking of creating config folder which will contain 3 sub-folders dev, stg & prod & I'll have the proprty file which will have this email variable defined. but I'm not clear of how to do this in PHP. I'm new to PHP. Can anyone guide me to resolve this issue??? Thnks!! Link to comment https://forums.phpfreaks.com/topic/118118-howto-environment-specific-files-in-php/ Share on other sites More sharing options...
trq Posted August 4, 2008 Share Posted August 4, 2008 One thing I have done in the past is load a specific configuration file depending on the value of $_SERVER['HTTP_HOST']. Link to comment https://forums.phpfreaks.com/topic/118118-howto-environment-specific-files-in-php/#findComment-607710 Share on other sites More sharing options...
freephoneid Posted August 4, 2008 Author Share Posted August 4, 2008 Thanks for the reply. But do I need to create same 3 files for different environments? I mean how do I do it? Thanks! Link to comment https://forums.phpfreaks.com/topic/118118-howto-environment-specific-files-in-php/#findComment-607714 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.