Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Virtual directories for multiple sites with common code?

Status
Not open for further replies.

Spork52

Programmer
Nov 20, 2007
134
0
0
US
I have several PHP sites which use common code (about 90% of the code is the same). All the sites are hosted on a dedicated Windows server.

Is there any reason I can't put the common code in a single directory and then use virtual directories in each site to access the code?

If so, where should I put the common code? (Does it matter where?)

And how would I accomplish this? The control panel (Helm) lets me add virtual directories to a site, but it seems they can only reference other folders in the same site.
 
Hello, go ahead, no problem.

The physical location is not important.

Hope this helps. Please let me know if this resolve your issue

Jeff
 
Okay, I tried it, but got these errors:

Warning: include(../../common/includes/connect.php) [function.include]: failed to open stream: No such file or directory in D:\ on line 21

Warning: include() [function.include]: Failed opening '../../common/includes/connect.php' for inclusion (include_path='.;C:\php5\pear') in D:\ on line 21

common is a virtual directory at the same level as website. It points to a real directory called common which is at the same level as mysite.com and contains the includes directory. I enabled read and run scripts when setting up the virtual directory.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top