Forum Moderators: coopster
sometimes i have to use $_ENV['DOCUMENT_ROOT'] . 'html/files/etc
or
other times i have to use $_SERVER['DOCUMENT_ROOT'] . '/html/files/etc, with a forward slash before the directory.
at the moment in phpinfo() i can only find the SERVER version, but i know this already, cos i've had to s & r lots of instances of this ;-)
does anyone have a clue why it should be changing?
btw i have been trying to upgrade php lots over the last week, with lots of apachectl restarts. but i didn't manage to upgrade, so the original version of php is still being used?
cheers
The entries in the $_SERVER array are created by the webserver. Assuming you are running Apache, you need to check your DocumentRoot [httpd.apache.org] directive. The DocumentRoot should be specified without a trailing slash, therefore when you add the rest of your path, you would need to prefix it with your slash as you mentioned.
Personally, I'd go with the $_SERVER global and make sure your directives are correct.