PHP Includes w/ Multiple Servers / File Structures

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hey All,

I'm trying to get feedback on how people handle "elevating" code from
a development environment to a production or qa environment.

Mainly my concern lies in how people manage php include statements.
Generally my sites are developed locally on my machine, then elevated
to a shared hosting environment as their "production" server. In the
past i've run into nothing but problems using include statements as
the file structures don't mimic each other. Now, the file structures
are obviously identical when you compare anything below my web sites
root folder but when you look at the entire heirarchy it never works

I have tried relative pathing, but i find that if i use relative
pathing to include a file in another folder, and that file in turn
includes another file it never can resolve the path correctly.

So any input on this odd problem would be appreciated.


Re: PHP Includes w/ Multiple Servers / File Structures

Quoted text here. Click to load it

Include relative to the document-root ($_SERVER['DOCUMENT_ROOT'] normally).

Also, for classes & php5, check the __autoload() function.

Rik Wasmus
Posted on Usenet, not any forum you might see this in.
Ask Smart Questions:

Site Timeline