We have PHP scripts that are being run from an AS/400 CL. How can I capture any/all errors that would be thrown from the PHP itself and move them into a non printer queue?
Announcement
Collapse
No announcement yet.
Override php errors to specific queue
Collapse
X
-
Re: Override php errors to specific queue
I would like to see a sample of that.
Can you post one of your CLLE programs?
JamieAll my answers were extracted from the "Big Dummy's Guide to the As400"
and I take no responsibility for any of them.
www.code400.com
-
Re: Override php errors to specific queue
I haven't done this but if sounds like from your description that the PHP errors are written to a spool file? If so, you can change the output queue with the job description or by issuing a CHGJOB within the CL.
Comment
-
Re: Override php errors to specific queue
@Jamie, sure!
Code:PGM PARM(&ORD &PGM) DCL VAR(&ORD) TYPE(*CHAR) LEN(6) DCL VAR(&PGM) TYPE(*CHAR) LEN(30) DCL VAR(&PARM) TYPE(*CHAR) LEN(60) DCL VAR(&LIBNAME) TYPE(*CHAR) LEN(10) + VALUE('BSDLIB ') DCL VAR(&PGMNAME) TYPE(*CHAR) LEN(10) + VALUE('WEBOCNFCL ') DCL VAR(&RUNDATE) TYPE(*CHAR) LEN(6) DCL VAR(&RUNTIME) TYPE(*CHAR) LEN(6) DCL VAR(&PGMUSER) TYPE(*CHAR) LEN(10) OVRDBF FILE(PGMLOG) TOFILE(PGMLOG) + RCDFMTLCK((PGMLOGPF *SHRUPD)) RTVJOBA DATE(&RUNDATE) CURUSER(&PGMUSER) RTVSYSVAL SYSVAL(QTIME) RTNVAR(&RUNTIME) CALL PGM(REFPGM) PARM(&LIBNAME &PGMNAME &RUNDATE + &RUNTIME &PGMUSER) CHGVAR VAR(&PARM) VALUE(&ORD *TCAT '&PA' *TCAT '&' + *TCAT &PGM) CALL PGM(QP2SHELL) + PARM('/USR/LOCAL/ZENDSVR/BIN/PHP-CLI' + '/WWW/ZENDSVR/HTDOCS/WEB/orderConfirmationE+ mail/orderConfirmation.php' &PARM) ENDPGM
Comment
-
Re: Override php errors to specific queue
Originally posted by Scott M View PostI haven't done this but if sounds like from your description that the PHP errors are written to a spool file? If so, you can change the output queue with the job description or by issuing a CHGJOB within the CL.
The easiest solution is to quit making mistakes in the code. <_< but somehow something always pops up.
Comment
-
Re: Override php errors to specific queue
Thanks for the sample, been thinking about this myself.All my answers were extracted from the "Big Dummy's Guide to the As400"
and I take no responsibility for any of them.
www.code400.com
Comment
-
Re: Override php errors to specific queue
It would change everything in the job. So you should use RTVJOBA to retrieve the current outq before you change it. Then after running your command the program can put it back to what is was originally.
Comment
-
Re: Override php errors to specific queue
Forgive me, I've not done a ton of CL programming before. You are talking something like this?
Code:RTVJOBA OUTQ(&USEROUTQ) CHGJOB OUTQ(PHPLOG) CALL PGM(QP2SHELL) + PARM('/USR/LOCAL/ZENDSVR/BIN/PHP-CLI' + '/WWW/ZENDSVR/HTDOCS/WEB/orderConfirmationE+ mail/orderConfirmation.php' &PARM) CHGJOB OUTQ(&USEROUTQ)
Comment
Comment