I am used to have the DocumentRoot being an absolute path to the website's DocRoot location, usually something like /usr/local/www/apache2/data/virtualhost_name
. This is then accessible from PHP via $_SERVER['DOCUMENT_ROOT']
variable.
I've hosted websites on several Shared Hosting Providers and they all had it this way. Now I moved to a new provider that has it set up differently. PHP's $_SERVER['DOCUMENT_ROOT']
always shows /
. I have several websites on the server in different folders but they still all show /
as DocumentRoot.
How can I achieve the same thing on my own development server?