Michael,

This works for DB2. It does not work for the i5 toolkit. Here is what
I did.

1) Setup up WRKRDBDIRE on local IBM i with pointer to remote IBM i.
2) Verify the remote connection is working via the CONNECT option in
ISQL (If it don't work in the Green Screen it won't work in PHP!)
3) Create PHP script that is going to access remote system using remote
name from WRKRDBDIRE
4) Must have credentials for remote system.

Let's chat if you have problems.

Regards,

Mike

mike.p@xxxxxxxx Cell: (408)679-1011 Office: (815)722-3454

Zend Server for IBM i Beta avilable at
http://www.zend.com/en/products/server/zend-server-5-new-ibmi



-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx [mailto:web400-bounces@xxxxxxxxxxxx]
On Behalf Of Michael Ryan
Sent: Tuesday, June 15, 2010 7:11 AM
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] Remote db2_connect in PHP

If I specify the local i (the one the PHP is running on), the
i5_pconnect
(or i5_connect) works. If I specify a different host name (my desired
target), the i5_connect fails.

If I use db2_connect and I either specify *LOCAL (with or without user
names), or leave the parameters null, the connect works. If I specify
the
remote host name, it fails.

I've also tried db2_connect with this approach:

$dsn = "DATABASE=$database;HOSTNAME=$hostname;
PROTOCOL=TCPIP;UID=$authID;PWD=$auth_pass;";
$i5 = db2_connect($dsn, "", "");

I still can't seem to get a connection made to a remote system to access
remote system tables.

Thanks...

On Tue, Jun 15, 2010 at 7:34 AM, Michael Ryan <michaelrtr@xxxxxxxxx>
wrote:

Sean:

In your i5_connect example, does $hostname contain the name of a
remote i?
That's what I'm trying to do.

Thanks...

- Michael


On Mon, Jun 14, 2010 at 4:15 PM, Porterfield, Sean <
SPorterfield@xxxxxxxxxxxxxxxxxxxxxxx> wrote:

I have:
$conn = i5_pconnect($hostname,$db2username,$db2password);

I haven't coded the db2_ myself, but I'm pretty sure that's what is
in
Mantis400.

For the Mantis connection, I have schema defined as well as hostname,
database name, user, password. Changing the database name caused it
to
connect to my other system.

I never specified a port number.
--
Sean Porterfield


-----Original Message-----
From: web400-bounces@xxxxxxxxxxxx
[mailto:web400-bounces@xxxxxxxxxxxx] On
Behalf Of Michael Ryan
Sent: Monday, June 14, 2010 10:55
To: Web Enabling the AS400 / iSeries
Subject: Re: [WEB400] Remote db2_connect in PHP

Does it need to be set up like this?

$database = "RDBNAME";
$hostname = "HOSTNAME";
$port = 50000;
$authID = "USERNAME";
$auth_pass = "PASSWORD";


$dsn = "DATABASE=$database;HOSTNAME=$hostname;PORT=$port;
PROTOCOL=TCPIP;UID=$authID;PWD=$auth_pass;";

$i5 = db2_connect($dsn, "", "", "");

I've tried it with and without the port. IIRC, 50000 is the DRDA
port.

On Mon, Jun 14, 2010 at 10:14 AM, Jim Oberholtzer
<midrangel@xxxxxxxxxx
wrote:

While I have not tried connecting without the Relational Database
Name
being different than what I am connecting to, I think it does need
to
be there. I even saw one install where one of the database names
was
"localhost". That took some time to figure out why we always got
DB/2
data instead of MySQL from the desktop.......

Jim Oberholtzer
CEO/Chief Technical Architect
Agile Technology Architects, LLC


On 6/14/2010 8:58 AM, Michael Ryan wrote:
*This message was transferred with a trial version of
CommuniGate(r)
Pro* Man...I'm having a problem connecting to a remote i using
the
db2_connect.
My PHP code works fine when I connect to *LOCAL. I'd like to run
my
PHP
code
on the same i as it is now, but have the db2_connect point to a
different
i.
What do I need to do to access the other i? I've googled and
checked
out
the
Zend manual, but the connection fails regardless of my technique.
Anyone have an example? Do I need a server running that would
normally run at
port
50000? Do I use the database name in relational database
directory?
Thanks!



This email is confidential, intended only for the named recipient(s)
above
and may contain information that is privileged. If you have received
this
message in error or are not the named recipient(s), please notify the
sender
immediately and delete this email message from your computer as any
and all
unauthorized distribution or use of this message is strictly
prohibited.
Thank you.
--
This is the Web Enabling the AS400 / iSeries (WEB400) mailing list
To post a message email: WEB400@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/web400.




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2024 by midrange.com 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.