homepage Welcome to WebmasterWorld Guest from 54.198.139.141
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Accredited PayPal World Seller

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
Will this weird application model work?
trevordixon




msg:3393202
 12:07 am on Jul 13, 2007 (gmt 0)

I'm getting started on a rather atypical PHP application. Tell me if this description sounds like a good idea or not:

Hundreds of domain names will be configured on a shared host to use the same document root directory. The PHP application files will look up a record in the database according to the domain name being requested. It's like name-based virtual hosting. Then according to that domain's configuration in our database, the right template files and data will be displayed.

Can any older, wiser developer reveal any unforeseen problems with this model?

Another thing, and maybe this should be a separate thread, but should I use a framework like CakePHP? Would such a framework play nicely with the sort of application I described above where the same code is used to generate vastly different websites? CakePHP or CodeIgniter are tempting because it sounds like they would rapidly speed up development, but maybe they have better application in another website. Also, CakePHP seems really slow. It takes like a quarter to half second just to produce a simple hello world kind of page with the default CakePHP configuration on my shared server.

Thanks for your advice,
Trevor

 

Slade




msg:3393236
 1:17 am on Jul 13, 2007 (gmt 0)

Consider these:

A) All sites are text/html with little to no unique php page building magic.

B) More than one site will require specially crafted templates or unique php page building magic to render.

If your sites are strongly type A, your idea is feasible.

If your sites are more strongly type B, I would not recommend that you handle them this way.

If most of the sites start out as type A, and only a *very* few grow to type B, then you can still proceed as planned for the type A's, and just get separate accounts for the type B's as needed.

You should consider .htaccess/ModRewrite as an alternative or supplement to your strictly php based solution. You could still keep them all in one account, but sub out the specific ones without having to build a framework for handling different domains in php.

trevordixon




msg:3393285
 2:46 am on Jul 13, 2007 (gmt 0)

Thank you for responding and for your suggestions. As most of the sites will use just three or four templates and plug in different data from MySQL, I'm thinking the "name-based virtual website" thing will be a viable solution.

Other thoughts and suggestions are still welcome.

Thanks,
Trevor

coopster




msg:3393762
 3:01 pm on Jul 13, 2007 (gmt 0)

I think sharing the same DOCUMENT_ROOT is going to cause issues in the future for you. Apache's Virtual Host setup is ideal for what you want to do. If you need to share common documents/templates/scripts in each site, then using a common repository and place that in the include path for each virtual site.

I think having a separate database for each site may also be a wise idea, but that is up to you and your design plans.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved