Debug batch php-cli?

General discussion on Zend Studio for IBM System i

Debug batch php-cli?

Postby dan1474 on Sat Aug 22, 2015 1:09 am

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!
dan1474
 
Posts: 1
Joined: Sat Aug 22, 2015 12:38 am

Re: Debug batch php-cli?

Postby scottgcampbell on Mon Aug 24, 2015 4:24 pm

The

[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 (http://www-01.ibm.com/support/knowledgecenter/ssw_ibm_i_71/rzamq/rzamqmain.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
Scott
scottgcampbell
 
Posts: 187
Joined: Wed Apr 22, 2009 2:29 pm
Location: Edmonton, AB, Canada


Return to Zend Studio for IBM i

Who is online

Users browsing this forum: No registered users and 1 guest