Page 1 of 1

[SOLVED] $_SERVER['DOCUMENT_ROOT']

Posted: Sun Apr 10, 2005 7:25 am
by bladecatcher
G'day All,
I have a named virtual host test.mysite.com
<VirtualHost *>
DocumentRoot /var/www/test
ServerName http://www.test.mysite.com
ServerAlias test.mysite.com
</VirtualHost>

Code: Select all

$docroot = dirname($_SERVER['DOCUMENT_ROOT'].'/');
$docroot returns "/var/www/" not "/var/www/test/"

Would some kind soul point my to a url where I can get my head around my mistake please?

Thanking you in anticipation,
bladecatcher

solved

Posted: Sun Apr 10, 2005 8:42 am
by bladecatcher
was staring me in the face 8-0
I was returning the parent directory, doh.


$docroot = $_SERVER['DOCUMENT_ROOT'];

works well.