Page 1 of 1

Debug batch php-cli?

Posted: Sat Aug 22, 2015 1:09 am
by dan1474
We've just started using PHP and Zend Server to grab data from our db2 tables and use the information to issue calls to a web API, then update the records in the tables. Our first PHP script runs fine when called interactively in QP2TERM, but when I submit it to batch using QP2SHELL or QP2SHELL it seems to have problems.

It's not a parameter issue in the calling CL, they are all null terminated and the script seems to start okay, but all I can see in the job log for the BCI job are two SQ99999 messages:
First reason code 9 (Argument value not valid), then reason 10 (Function sequence error). The zend server php log just shows repetitions of:
[21-Aug-2015 16:17:25 America/Creston] var0
[21-Aug-2015 16:17:36 America/Creston] var0
[21-Aug-2015 16:19:09 America/Creston] var0
[21-Aug-2015 16:19:20 America/Creston] var0

I've managed to get remote debugging working in Zend Studio for scripts called interactively; is it possible to debug php-cli running in batch (similar to the way I can strsrvjob on an IBM i program)? I tried submitting the PHP to Qshell and rerouting stderr, but the job just ends without producing any log (where the PHP script should be looping); probably a syntax error in the call, but not one I can find!

Any help/suggestions would be gratefully received.

Thank you!

Re: Debug batch php-cli?

Posted: Mon Aug 24, 2015 4:24 pm
by scottgcampbell
[21-Aug-2015 16:19:20 America/Creston] var0
is debug info coming from the compatibility wrapper (or i5Toolkit), don't remember where exactly but I took it out of my copy.

Can you post an example of how you are calling the script both interactively and in batch?

I've used the IBM system debugger ( ... mqmain.htm) on the calls but it takes a while sometimes because you can't guarantee which job will be processing each request, but if you connect with a specific user you can look to see if there are QSQSRVR jobs for that user and try to debug those.

Hope that helps