LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Bug Reports > document_root trailing slash

Reply
 
Thread Tools Display Modes
  #1  
Old 09-13-2011, 07:40 AM
anything anything is offline
Member
 
Join Date: Jun 2010
Posts: 40
Default document_root trailing slash

A small problem when moving a server from apache to litespeed
my apache config defines document root as
DocumentRoot "/path/name/goes/here/"
note the trailing slash.

under apache, php saw:
$_SERVER['DOCUMENT_ROOT'] = '/path/name/goes/here/'

under litespeed, php sees:
$_SERVER['DOCUMENT_ROOT'] = '/path/name/goes/here'

this is causing some old sites of ours to break when the php code does something like
include($_SERVER['DOCUMENT_ROOT'].'filename.php');


normally the trailing slash isnt used in our config, but seems for several vhosts it was, so the programmer wrote the includes as above when developing it.
there were likely thousands of references like that, so my temporary solution was to add a auto_prepend_file script that adds the trailing slash


is it possible that a future lsws release will mirror what apache does?
ie, keep the document root exactly as provided (with, or without trailing slash)
Reply With Quote
  #2  
Old 09-13-2011, 11:19 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 7,590
sure. will do.
Reply With Quote
  #3  
Old 09-14-2011, 03:44 AM
anything anything is offline
Member
 
Join Date: Jun 2010
Posts: 40
thank you.
Reply With Quote
  #4  
Old 10-14-2011, 04:31 AM
Gerry Gerry is offline
Member
 
Join Date: Feb 2008
Posts: 29
Could it be that this was implemented in 4.1.5?

Since upgrading to 4.1.5, the DOCUMENT_ROOT variable under LiteSpeed ALWAYS has a trailing slash. Our vhost configuration defines all DocumentRoot directives without slash.

This broke quite a few sites, so we're back on 4.1.4 until this gets resolved.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 03:20 AM.



- Archive - Top
© Copyright 2003-2011 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.