Is there another way to run my php program in batch from the IBM i?

What I do is the following:

SBMJOB CMD(QSH CMD('chroot /QOpenSys/mwh001 /bin/bash -c
''/path/to/ parm1 parm2'' '))

In I have the environment setup (i.e. PATH, set language version,
etc) and then invoke my actual program (i.e. Node.js, Ruby, etc).

Aaron Bartell
IBM i hosting, starting at $157/month.

On Thu, Jan 5, 2017 at 2:17 PM, <MWHopkins@xxxxxxxxxxxxxxx> wrote:

Thanks everyone - I was able to SSH in and get everything configured and

So now I am working on my ultimate goal which is to have a php cli script
run from the job scheduler at certain times of the day. I attempted to
create a shell script that will chroot into my jail, then call the php

#! /bin/sh
chroot /QOpenSys/mwh001 /usr/bin/bsh
cd /home/mwh001/aws_php
php InstanceInterface_v2.php "$1" "$2"

If I try to run this with a privileged profile from a 5250 command line.
[CALL PGM(QP2SHELL) ] I get a message that it is not found...

/QOpenSys/usr/bin/-sh: /QOpenSys/mwh001/home/mwh001/aws_php/ not

I get that error even when I go into PASE (QP2TERM) and call the shell
script from that command line.

I know the .sh script exists and is accessible from the profile, so I'm
not sure what it can't find. If I run each line interactively it works
like a charm...

-rwxrwxrwx 1 mwh001 0 120 Jan 5 14:28

Is there another way to run my php program in batch from the IBM i?

Matt Hopkins
EDI/Web Services Developer
Information Technology
Email: MWHopkins@xxxxxxxxxxxxxxx
Office: 410-584-0330
Cell: 410-258-8845
Support: EDISupport@xxxxxxxxxxxxxxx

From: Aaron Bartell <aaronbartell@xxxxxxxxx>
To: IBMi Open Source Roundtable <opensource@xxxxxxxxxxxx>
Date: 01/04/2017 02:57 PM
Subject: Re: [IBMiOSS] Attempting chroot
Sent by: "OpenSource" <opensource-bounces@xxxxxxxxxxxx>

I could write up some sample code to do that. Not sure where I'd put it,

lots more stuff.....

This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: OpenSource-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives

As an Amazon Associate we earn from qualifying purchases.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.