I use $_SERVER[\'DOCUMENT_ROOT\'].\"/lib/sft_required.php\"; to include the \'sft_required\' file in a PHP script. When I run this file using browser, it works fine but whe
I answered a similar question here. As people have mentioned, the superglobal $_SERVER isn't defined in CLI situations. In the link is a (so far) foolproof method for obtaining the DOCUMENT_ROOT location. Hope it proves useful.