Apache 2, VirtualHost, Alias, PHP
October 3, 2007 12:05 PM   Subscribe

Apache 2, VirtualHost directives, Alias, PHP's DOCUMENT_ROOT variable - confusion!

I have a few VirtualHosts. Each VirtualHost has an Alias, defined in the root httpd.conf - this Alias points to an app. On some servers, referencing $_SERVER['DOCUMENT_ROOT'] shows me the application's document root (not preferable) and on other servers, this value is the is the site's document root (preferable). The app is always accessed through the Alias.

Any ideas how to make this consistent?
posted by xmutex to Technology (2 answers total)
 
Response by poster: Another issue is (I'm on OS X) that DOCUMENT_ROOT shows one directory, but readdir'ing through that using a handle shows a different directory's contents - namely, the current working directory (the root of the Alias'ed app).

What the hell is going on?
posted by xmutex at 12:22 PM on October 3, 2007


Response by poster: Ah - I guess there's some issue with realpath() on PHP 5.2 and OS X/BSD.
posted by xmutex at 12:54 PM on October 3, 2007


« Older Tutor Registration form in open source?   |   Cool E-Commerce? Newer »
This thread is closed to new comments.