Multiple sites on one dev box

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
nacer
Forum Newbie
Posts: 1
Joined: Mon Feb 02, 2004 1:06 pm

Multiple sites on one dev box

Post by nacer »

I'm developing more than one web site on the same dev box. I've put each site into it's own subfolder. When I go to upload one of them to it's live server, all my include's must be changed to reflect the base url of the live server. In other words, I have to delete the subfolder name from everything. Is there a neat trick to get around going in and re-coding all my includes and web addresses to reflect the main server?
User avatar
mikusan
Forum Contributor
Posts: 247
Joined: Thu May 01, 2003 1:48 pm

Post by mikusan »

Make a "config.php" where you declare the following variable:
$CFG['site_dir'] = '/var/www/whatever';

Then, in every file, include the config.php file, working on the assumption that it is in the same directory, or if necessary add /../../

This means you only have to change the variable once.
Post Reply