The reason is that $_SERVER['DOCUMENT_ROOT'] does not give the path to executing (.php) files location when used with Apache alias (at least on my local WAMP and on my Linux host).
dirname(__FILE__) (as in get_root_path()) should be used instead.
EDIT: More about unexpected DOCUMENT_ROOT values: https://issues.apache.org/bugzilla/show_...i?id=26052
Wishes,
dirname(__FILE__) (as in get_root_path()) should be used instead.
EDIT: More about unexpected DOCUMENT_ROOT values: https://issues.apache.org/bugzilla/show_...i?id=26052
Wishes,