LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


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

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, 10:40 AM   #2
vharishankar
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

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).

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


Reply


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 08:46 AM
when to use environment variables? mark_2811 Programming 2 02-23-2004 06:09 PM
Environment Variables if you su concoran Linux - Newbie 1 08-16-2002 07:18 PM
environment variables. jISV Linux - General 0 04-05-2002 06:01 AM
environment variables da Perp Linux - Newbie 5 01-23-2002 09:34 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:25 AM.

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