I've developed a web application that I would like to be able to distribute to a few people.
Right now, each page has a include to a config.php file that has all the site info that needs to be changed for a different server (upload path, site url, header, footer locations, database info...). So currently, if I want install the application on another server, i need to do a sitewide search in dreamweaver (or the likes) and change the link sitewide. The link is like (/home/user/domains/domain/public_html/admin/includes/file.php).
Is there an easier way to do this so I don't have to change it for each server? I'm betting there is and I don't know it. I don't even know what to search for, so hopefully someone can point me in the right direction.
EDIT:
I tried $_SERVER["SITE_HTMLROOT"];
and that gave me nothing.
system path, for different servers
Moderator: General Moderators
-
natatkinson
- Forum Newbie
- Posts: 4
- Joined: Wed Jul 23, 2008 3:02 pm
Re: system path, for different servers
You may use paths like:
http://www.php.net/realpath
Code: Select all
realpath(".")."/include/config.php"There are 10 types of people in this world, those who understand binary and those who don't
-
natatkinson
- Forum Newbie
- Posts: 4
- Joined: Wed Jul 23, 2008 3:02 pm
Re: system path, for different servers
that seems to work well, although I need to make the path different for each folder, but thats not a big deal.
Thank you very much!!!!!
Thank you very much!!!!!