include problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: include problem

Post by califdon »

Typically, a developer establishes a subdirectory (often named /inc) where all include files are stored. This path can then be defined as include_path (I think in php.ini) and then used wherever an include file is called for. It's not at all a complicated process.
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: include problem

Post by Vegan »

I use a lot of domains for various topics that I manage. Each has its own set of components. Some are widely unique.
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: include problem

Post by John Cartwright »

I just re-read the entire thread, and am very confused as to what your issue is.

You are having trouble setting up relative paths from within your document root?

Perhaps if you post the absolute paths of what you are trying to include and then your document root.
User avatar
califdon
Jack of Zircons
Posts: 4484
Joined: Thu Nov 09, 2006 8:30 pm
Location: California, USA

Re: include problem

Post by califdon »

Vegan wrote:I use a lot of domains for various topics that I manage. Each has its own set of components. Some are widely unique.
So?? Just name your include files so you can call the appropriate one when you need to. They can still all be put in the same directory. This gets back to how you are hosting these domains. I'm assuming that you are using one Apache server, probably in Virtual Host mode. If you are, then you may want to have an /inc directory in each DocumentRoot.
User avatar
Vegan
Forum Regular
Posts: 574
Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:

Re: include problem

Post by Vegan »

I was hoping Apache put the doc root for each site in an environment variable.
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Post Reply