PHP CLI Call

General discussion on Zend Core for IBM System i
Post Reply
mlavinder
Posts: 87
Joined: Fri Apr 10, 2009 3:12 pm

PHP CLI Call

Post by mlavinder » Fri Apr 10, 2009 3:20 pm

I am doing a PHP CLI call from an RPG. If I run it using the QzshSystem procedure, it doesn't work. I used the API to retrieve the errno and message and it was 'Descriptor not valid'. I changed the RPG to run a CL program that uses the QSH command to run the exact same command. That runs fine.

I am curious...why doesn't the procedure work? Since it works with the QSH command, this isn't pressing, but I am trying to learn more about PASE and the Unix-API stuff.

Thanks,
Matt

jess04
Posts: 628
Joined: Thu Jan 15, 2009 3:37 pm

Re: PHP CLI Call

Post by jess04 » Fri Apr 10, 2009 6:52 pm

Hello,

Can you paste the PHP code you're attempting to run?
That will help us better understand the problem since we can try to reproduce it.

Thanks,
May the source be with you,

Jess Portnoy

zend_i5
Posts: 158
Joined: Mon Mar 23, 2009 5:22 pm

Re: PHP CLI Call

Post by zend_i5 » Sun Apr 12, 2009 9:16 pm

Running PHP CLI in i5.

1. From the default PASE shell.
- call qp2term - starts the PASE shell
- /usr/local/Zend/core/bin/php-cli -help - runs PHP CLI

2. From the i5 command line (or CL program)
CALL PGM(QP2SHELL) PARM('/usr/local/Zend/core/bin/php-cli' '-help')

3.From QSH.
- QSH - starts QSH
- /usr/local/Zend/core/bin/php-cli –help - runs PHP CLI

Example
CALL PGM(QP2SHELL) PARM('/usr/local/Zend/core/bin/php-cli' '/www/zendcore/htdocs/DB2_example.php')

mlavinder
Posts: 87
Joined: Fri Apr 10, 2009 3:12 pm

Re: PHP CLI Call

Post by mlavinder » Tue Apr 21, 2009 7:47 pm

I posted on another forum and Scott Klement advised against using the QzshSystem. I've also since discovered the QP2SHELL program and that seems to work well and fit my needs nicely.

Thanks.

Post Reply