Thank you for your time in advance.
I have a php script that is supposed to run once daily. We set up a scheduled task on the client's server and it executes a batch file that essentially calls the following:
php-cgi.exe -d short_open_tag=On ".\my_script.php"
If I navigate directly to my_script.php via the browser everything works fine. When I execute the batch script from either the command line or via a scheduled task I'm given multiple errors.
Lines giving errors:
$document_root = $_SERVER[ 'DOCUMENT_ROOT' ];
$_SERVER[ 'FULL_URL' ] .= $_SERVER[ 'SCRIPT_NAME' ];
If I var_dump() the $_SERVER variable I see both the DOCUMENT_ROOT and SCRIPT_NAME are there and populated properly. I have the scheduled task running with highest privileges under the SYSTEM user.
What can I do to stop these errors from the command line and the scheduled task?
When calling the batch file from the stored procedure I incurred errors but when I called php-cgi.exe directly and added my arguments to the arguments textbox everything ran perfectly.
I'm guessing my batch file didn't have the proper permissions.