Currently I have an Ubuntu 12.04 webserver running apache2. I have it setup to dynamically create subdomains by creating new folders under /sites/example.com/*/public /sites/example.com/www/public is reserved for my main root site.
This is working out, however I am unable to configure PHP's $_SERVER['DOCUMENT_ROOT'] to be dynamic to the newly created folder.
When I echo $_SERVER['DOCUMENT_ROOT'] I get /etc/apache2/htdocs which I assume is some sort of default path. I would like this to be: /sites/example.com/*/public instead
# Wildcards
<VirtualHost *:80>
VirtualDocumentRoot /sites/example.com/%1/public
ServerAdmin [email protected]
ServerAlias *.example.com
</VirtualHost>
Curious why PHP doesn't pick up the the virtual document root setting above, I'm likely doing something wrong.