Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 12-04-2011, 10:19 AM   #1
Senior Member
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 9.2
Posts: 1,103

Rep: Reputation: 48
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.
Old 12-04-2011, 11:40 AM   #2
Senior Member
Registered: Dec 2003
Posts: 3,161
Blog Entries: 4

Rep: Reputation: 136Reputation: 136
If you're using PHP, you can access environment variables using $_ENV

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

Last edited by vharishankar; 12-04-2011 at 11:41 AM.
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
environment variables user_linux Linux - Newbie 3 06-15-2005 09:46 AM
when to use environment variables? mark_2811 Programming 2 02-23-2004 07:09 PM
Environment Variables if you su concoran Linux - Newbie 1 08-16-2002 08:18 PM
environment variables. jISV Linux - General 0 04-05-2002 07:01 AM
environment variables da Perp Linux - Newbie 5 01-23-2002 10:34 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:46 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration