Web_root incorrect in installs using symbolic link to DOCUMENT_ROOT

tmccormi wrote on Wednesday, February 12, 2014:

I ran across this in a setup where the base installation image using a mounted drive for data storage.

The drive is mounted at /mnt/datadrive/opt/www/… etc
/opt is a symbolic link to that location

the code in interface/globals.php below incorrectly creates a web_root that is too long by the of “/mnt/datadrive/”

// Auto collect the relative html path, i.e. what you would type into the web
// browser after the server address to get to OpenEMR.
$web_root = substr($webserver_root, strlen($_SERVER['DOCUMENT_ROOT']));

Essentially the DOCUMENT_ROOT to be the full linked path and the $webserver_root is the full path including the /mnt point due to using this:

$webserver_root = dirname(dirname(__FILE__));

as it’s 1am, I have not thought of a pretty solution yet…

-Tony