Hello everyone! I know I must be doing something wrong, but I can't seem to figure out what it is! When I use: include '/dev/OnlineStores/lib/olsWebApp_Common.php'; PHP: .. I get the following error message: However, I can literally take the path given in the error message ("/dev/OnlineStores/lib/olsWebApp_Common.php"), punch it into my address bar, and the page loads just fine. The php file that uses the include currently resides in /dev/OnlineStores/svc/poapprove/list.php. If I use a relative path (i.e., "../../lib/olsWebApp_Common.php") it works just fine, just not the full path. The crazy thing is that I've include()'d the exact same full path on other pages in the site without any problem! I'm admitting defeat and hoping somebody else sees what I'm missing. Thanks in advance!
Just in case this helps, here's the directory structure: ROOT -/dev --/OnlineStores ----/lib ----/css ----/imb ----/log ----/svc -------/poapprove -----------list.php <--- file that uses the include()
Is ROOT your site root or your server root? Try: include 'dev/OnlineStores/lib/olsWebApp_Common.php'; (removing the / at the beginning)
The ROOT is the server root, which is why I'm confused. Actually, adding $_SERVER['DOCUMENT_ROOT'] in front of the include fixed the problem. The total code is: include $_SERVER['DOCUMENT_ROOT'] . '/dev/OnlineStores/lib/olsWebApp_Common.php'; PHP: I can't say I totally understand why this works and the other way doesn't, but I'm happy either way. Thanks for your reply
PHP doesn't work like CSS and HTML, it doesn't go from current location or take "/" to mean go to root. That will be what was creating the problem