PHP document root

From SME Server

Document Root issue


If you set up an application in an ibay you may have some odd results due to the usage of $_SERVER['DOCUMENT_ROOT'] by the application.

By default this is set in php.ini to :


This can cause lots of issues.

To test this, create a file called phpinfo.php in the root html folder of your ibay.

nano /home/e-smith/files/ibays/ibayname/html/phpinfo.php

Now add the following line :


Save by ctrl+x And access it with a browser :

Look for the Document Root setting.

How to overcome $_SERVER['DOCUMENT_ROOT'] issues in ibays

The simplest way to avoid this is to setup a subdomain and point it to the ibay.

For example

Your current host/domain :

In server-manager Add Domain :

Domain Name :
i-bay       : mybay
DNS Servers : resolve locally

Now you can access the mybay directory like this :

Try phpinfo.php

If you want external access then create a new A record with your DNS hosting pointing your IP address to