LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Environment Variables (https://www.linuxquestions.org/questions/programming-9/environment-variables-917061/)

rblampain 12-04-2011 09:19 AM

Environment Variables
 
How can I use the same links in a site on my home pc and on my hosted VPS just by changing an Environment Variable on each machine?

I got the answer to that question years ago but I cannot find it now.

My purpose is to test the site on my local machine and then upload it to the VPS.

I can edit Apache2 files.

Thank you for your help.

vharishankar 12-04-2011 10:40 AM

If you're using PHP, you can access environment variables using $_ENV

http://php.net/manual/en/reserved.va...nvironment.php

To set environment, use export from the command line (some shells like tcsh use setenv to set environment variable).


All times are GMT -5. The time now is 06:14 PM.