Document root problem + fix

Found a bug? Tell us!!
Post Reply
Cynebeald
Regular
Posts: 10
Joined: Sun Jan 06, 2008 8:11 pm

Document root problem + fix

Post by Cynebeald »

There's a problem with using the $_SERVER['DOCUMENT_ROOT'] variable, because it's often not correctly set. While serendipity does a lot of work to determine where and how it's installed, I still get some warnings because the document root isn't a real place.

I found a solution to this problem on http://www.helicron.net/php/, but on my host, the basename/realpath trick doesn't do it, and I have to get the $absolutepath from SCRIPT_FILENAME. Otherwise, it looks perfect, I just have to set the $_SERVER['DOCUMENT_ROOT'] variable to the calculated value.
Post Reply