Forum Moderators: coopster
I prefer to specify it as a url eg Include ("www.yourdomain.com/include/.....");
There may be a better way. If there is I'm as keen to know as you!
It's the Good PHP solutions to small problems [webmasterworld.com] thread in our PHP Forum Library.
Anyway, for a dissenting view.... see the last three paragraphs of
[webmasterworld.com...]
TheRookie, this thread may help you understand how PHP processes an include():
include path error... [webmasterworld.com]
As the number of sites on my development platform grows, I'm thinking I also need to streamline this in some intelligent way. The part I haven't figure out is, when I upgrade a tool, how do I synch all live sites that tool has been used on?
As for development, though, since I'm using virtual hosts on my development machine, my dir structure is like this
htdocs
->site1
-> ->www
-> ->other
->site2
-> ->www
-> ->other
->tools
so from DOC_ROOT and server root for a given site, the path to tools is
DOC_ROOT/../../tools/
which means that the path won't necessarily be the same on a live server (I have two sites I've worked recently on where the account does not even have access outside of web root). That can be handled fine with path constants, but lately I'm trying to just mirror the live and local sites on virtual servers, and that model breaks down in the example just given. I just recently learned that windows (I use Win2K for my workstation) can do symlinks. So I think what I'll do in the future is something like this
htdocs
>site15
>>www
>>tools
and >>tools will use a symlink to the actual tools repository. Otherwise live sites would either require
- a different config file than the local site and that gets confusing
- live sites would be constrained by the file setup on my development platform and that makes no sense either.
Since I haven't done this yet, I'd definitely care to hear dissenting opinions on that too!
On symlinks under windows (called junction points)
See also the user notes at
[us4.php.net...]