Today an interesting problem has arisen. A piece of code that relies on the Server Document Root suddenly stopped working on only my browsers. My machine is where I develop locally using xampp, and all other machines do not present this problem. This error is occurring on the actual live remote webserver.
The server document root of a remote, live website, is being returned as
(/usr/local/apache/htdocs/): failed to open stream: No such file or directory" for me as an error when executing
$_SERVER['DOCUMENT_ROOT']. On all other machines and even earlier this week, it was returning the public_html/root directory of my web server just fine. Somehow my machine or browsers are overriding remote document root requests to my local apache installation.
Cache clears, browser re-installs, and reboots have been done. I'm genuinely not sure how to begin to approach this issue. Thank you for your time.
My web host replied that the httpd.conf of my remote server states the following:
<VirtualHost xx.xx.xxx.xx:xx> DocumentRoot /home/v1/public_html
As for my local xampp, the httpd.conf DocumentRoot line is as follows:
The full error line is as follows:
Warning: parse_ini_file(/usr/local/apache/htdocs/../content/config.ini): failed to open stream: No such file or directory (php file) at line 25.
Line 25 is just a parse_ini_file command that directs to a folder on the server. On other machines, it will properly evaluate as "/home/v1/public_html", but not from my development machine.