You are here: Re[2]: [PHP] SOLVED: Re: [PHP] Document root, preferred way to find it??? « PHP « IT news, forums, messages
Re[2]: [PHP] SOLVED: Re: [PHP] Document root, preferred way to find it???

Posted by Tom Rogers on 03/08/05 01:59

Hi,

Tuesday, March 8, 2005, 12:03:54 AM, you wrote:
LG> Hello Tom,

LG> Sunday, March 6, 2005, 11:20:04 PM, you wrote:
T>> I do this for security as I have things in include that I don't
T>> want to be avaiable directly to the browser Also you don't need a
T>> path for include files you can just do:

LG> Don't necessarily disagree with you there other than if you place the
LG> includes outside the web accessible folders how do you address the
LG> managers of virtual hosts for the ability to modify, delete or add to
LG> their particular include file? Additionally, how do you address
LG> the naming convention of the include file.

LG> i.e.
LG> Site 'A' is using config.php
LG> Site 'B' is using config.inc.php
LG> Site 'C' wants to use config.php



T>> include('somefile.php');
T>> and it will be found regardless of where the script is located.

LG> That's true enough..

LG> BTW, good to see another TheBat! user here.

LG> Thanks again.

I only do stuff for my own server which actually creates a couple
of server variables called:

SERVER["DOMAIN_ROOT"] and SERVER["PHPINCDIR"] which have the same
values as the script we just cobbled together for each virtual
domain.
I don't suffer from the problem of lack of access to the
include directory, So all my domains follow this layout:

/usr/local/apache/domains/domain1.com //root and chroot for ftp
access
/usr/local/apache/domains/domain1.com/www web document root

/usr/local/apache/domains/domain1.com/include for all include files

If a hosting provider locks you in to the document root it's time to
change provider :)
As for naming convention I use .inc and stop apache from serving .inc
files.

--
regards,
Tom

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация