[UPHPU] How do you lay out your PHP project directories?

Brandon Stout bms at mscis.org
Tue May 13 22:29:39 MDT 2008

Nathan Lane wrote:

> Hey, I was messing around with an IDE for developing PHP the other day named
> Delphi For PHP. I noticed pretty quickly that it was adding some of its own
> PHP libraries and using them, but those libraries weren't located in the
> root of my web server, rather they were located in a directory completely
> separate from my Apache web root. How does one accomplish this? Namely use
> PHP files not in your web root. We do it in ASP.Net at my work, where we
> have a service host that resides under Program Files, and the web root for
> the particular IIS ASP.Net application is located under the IIS web root. Is
> it something that I have to change in my apache config, or my php config to
> do this? Can anyone help me do this? Basically the reason I want to do this
> is to separate my framework from my web page, so that it is simpler to use
> the same installed framework (php) for multiple sites on the same server, or
> set of servers.

You can use php.ini's include_path directive as shown on this page:


Or you can specify a full server path with require(), require_once(), 
include(), or include_once(), as shown on this page:


You can also use __autoload and other Object Oriented methods to load 
php files outside the web root.

Brandon Stout

More information about the UPHPU mailing list