Hi
I'm pretty new to PHP to excuse the newbie question.
I have a PHP file which I'd like to run on a schedule. On exit() it returns a number which is 0 for "All OK" and anything else for an error.
I've tried evaluating the ERRORLEVEL in the batch file but it comes back as 0. Below is my test:
@echo off
c:\php\php.exe -q c:\test\world.php
IF ERRORLEVEL 0 GOTO OK
IF ERRORLEVEL 1 GOTO NOTOK
:OK
ECHO "OK"
GOTO END
:NOTOK
ECHO "NOT SO GOOD"
GOTO END
:END
And this is the test PHP file:
#!/usr/bin/php -q
<?php
exit(1);
?>
Any suggestions appreciated.
"There are only two lasting bequests we can hope to give our children; one of these is roots, the other wings" - Hodding Carter
I'm pretty new to PHP to excuse the newbie question.
I have a PHP file which I'd like to run on a schedule. On exit() it returns a number which is 0 for "All OK" and anything else for an error.
I've tried evaluating the ERRORLEVEL in the batch file but it comes back as 0. Below is my test:
@echo off
c:\php\php.exe -q c:\test\world.php
IF ERRORLEVEL 0 GOTO OK
IF ERRORLEVEL 1 GOTO NOTOK
:OK
ECHO "OK"
GOTO END
:NOTOK
ECHO "NOT SO GOOD"
GOTO END
:END
And this is the test PHP file:
#!/usr/bin/php -q
<?php
exit(1);
?>
Any suggestions appreciated.
"There are only two lasting bequests we can hope to give our children; one of these is roots, the other wings" - Hodding Carter