jjrosen Posted February 25, 2008 Share Posted February 25, 2008 I'm making a clone of a website I've made on another server using the same LAMP distrobution (xampp). I use the line require_once $_SERVER['DOCUMENT_ROOT']."../admin/somefile.php"; (I put my admin files outside of the document_root This works fine on the first server I set it up on. $_SERVER['DOCUMENT_ROOT'] has a slash added to the end of it on Server A But on Server B, I get an error because I it tries to require '/blah/blah/blah../admin/somefile.php' and there's no directory 'blah..' it should be 'blah/..' Please let me know if there's a setting to add that slash back to the end, I really don't want to change some unimaginable amount of lines to add one slash, and have to remember to do that everytime I update Server B. Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/92972-_systemdocument_root-missing-slash-or-has-extra-slash/ Share on other sites More sharing options...
wildteen88 Posted February 26, 2008 Share Posted February 26, 2008 Open up the httpd.conf file for Server B and just add a forwardslash to the end of the DocumentRoot directive. Save httpd.conf and restart Apache. $_SERVER['DOCUMENT_ROOT'] should now end paths with forward slash. Quote Link to comment https://forums.phpfreaks.com/topic/92972-_systemdocument_root-missing-slash-or-has-extra-slash/#findComment-477250 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.