6.0.0-beta1
9/6/25

[#2505] Horde's use of PHP_SELF to determine "webroot" creates problems with symlinked directories
Summary Horde's use of PHP_SELF to determine "webroot" creates problems with symlinked directories
Queue Horde Framework Packages
Queue Version FRAMEWORK_3
Type Bug
State Not A Bug
Priority 2. Medium
Owners
Requester nick.maynard (at) alumni (dot) doc (dot) ic (dot) ac (dot) uk
Created 08/24/2005 (7318 days ago)
Due
Updated 08/25/2005 (7317 days ago)
Assigned
Resolved 08/24/2005 (7318 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
08/25/2005 12:21:03 PM nick (dot) maynard (at) alumni (dot) doc (dot) ic (dot) ac (dot) uk Comment #3 Reply to this comment
Hello Jan,



Where is this configuration option?  I've found that in order to 
manually set the webroot, I've had to comment out the auto-detection 
section of registry.php and set the variable value again manually:



/*

if (isset($_SERVER['PHP_SELF'])) {

     $webroot = strstr(dirname(__FILE__), '/' . 
array_shift(preg_split(';/;', $_SERVER['PHP_SELF'], 2, 
PREG_SPLIT_NO_EMPTY)));

     if ($webroot !== false) {

         $webroot = preg_replace(';/config$;', '', $webroot);

     } else {

         $webroot = '/horde';

     }

} else {

     $webroot = '/horde';

}

*/

$webroot = '/horde';



If I don't do the above, the PHP_SELF detection logic kicks in and 
determines the wrong webroot.



Cheers,

Nick
08/24/2005 01:12:28 PM Jan Schneider Comment #2
State ⇒ Not A Bug
Reply to this comment
The automatic webroot detection is a convenience for people too lazy 
to configure Horde properly. If it would work in all cases, we 
wouldn't make it a configuration option.
08/24/2005 01:00:33 PM nick (dot) maynard (at) alumni (dot) doc (dot) ic (dot) ac (dot) uk Comment #1
State ⇒ Unconfirmed
Priority ⇒ 2. Medium
Type ⇒ Bug
Summary ⇒ Horde's use of PHP_SELF to determine "webroot" creates problems with symlinked directories
Queue ⇒ Horde Framework Packages
Reply to this comment
Horde uses PHP_SELF to determine "webroot" in registry.php



My server setup uses the following:

horde-3.0   (real directory, where horde-3.0 lives)

horde->horde-3.0   (symlink)



This creates problems with the following:

- I direct my users to use /horde, and they are redirected to 
/horde-3.0 by Horde

- My cookie path setting of "/horde" means that cookies can't be used 
for sessions



Horde 2.x allowed admins to force the "webroot" setting, which 
effectively bypassed this problem.



I notice that "webroot" is now derived from PHP_SELF - can we include 
a configuration option that allows the admin to force this to any 
value he wishes?



Cheers,

Nick

Saved Queries