[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [cobalt-users] Changing DocumentRoot from ../web to ../web/



On Tue, 4 Sep 2001 johan@xxxxxxxxxx wrote:

> Hi there,
> 
> We are busy testing a large PHP driven site for a client with a view to move 
> them over to a dedicated RaQ.  
> 
> Their current Apache DocumentRoot is set to "../whatever/web/", but the RaQ 
> uses "../whatever/web", dropping the final slash.  And they are using the 
> $ROOT_DOCUMENT variable all over in their PHP files as part of include 
> statements.  This is obviously created some havoc, since PHP is trying to 
> include files with incorrect path names such 
> as "../whatever/webincludes/config.inc" instead 
> of "../whatever/web/includes/config.inc" 
> 
> The easiest would be by far to just change the RaQ setting to include the slash.
> Is there any reason why one cannot change the DocumentRoot setting to include 
> the slash?  I can't think of any, unless Webalizer or some Cobalt specific 
> executable prefers the path the exclude the slash?

The path variables to CGI's are constructed from this, and will end up
with double slashes....tho it's not fatal, it can be mesy looking ;)

This is very poor php code, it is VERY traditional to not include trailing
slashes in unix paths , including apache documentroot specification, tho
it does have nasty implications, eg $PATH/foo resolves to /foo is PATH is
empty...ouch

 > 
> Another option would be to use .htaccess?

no, changing documentroot from .htaccess is forbidden, (it changes where
.htaccess is supposed to be after the fact ;)

mass search and replace on the php code? why are they imbedding this
variable anyhow? they should be putting it in another variable so you can
install the code in some arbirtary subdirectory if wanted....sigh

This doesn't really answer the whole question, tho i doubt adding the
slash would really hurt anything in a php only environment, you may have
to actually try it to be really certain....

gsh