Don't understand if I installed everything

22 views
Skip to first unread message

tremor_tj

unread,
Apr 10, 2009, 5:38:46 PM4/10/09
to phpsam
I'm trying to get this installed on Red Hat ES 3 with php 4.4.2.

I installed MQSeriesClient, Runtime, Samples, and SDK, all version
6.0.2-6.

I also installed the gsk7bas-7.0-4.20.i386.rpm.

In my /etc/php.ini file I included both extension=sam.so and
extension=sam_xms.so .

On the phpinfo.php, it show both modules loaded.

When we try to make a connection, we're getting the following:

PHP Fatal error: Call to undefined function: samxmsconnection() in /
usr/local/lib/php/SAM/sam_factory_xms.php on line 31


Do any of you see what I may be missing? I'm at a loss on what I may
have done to set this up wrong, or if my developer may not be calling
it right.

Ian Burnett

unread,
Apr 12, 2009, 6:28:51 PM4/12/09
to php...@googlegroups.com
Do you have any code showing how your developer is trying to call the
PHP SAM library?

You didn't mention installation of the XMS library - this is a
requirement (and provides much of the abstraction between the generic
SAM messaging interface and the MQ CONN/OPEN/GET/PUT interface). It's a
free download from here:
http://www-01.ibm.com/support/docview.wss?uid=swg24007092 (or search for
"IBM IA94").

gsk7bas is the IBM Global Security Kit - only required if you are
enabling secure connections between client and server.

Ian.

--
Ian Burnett :: http://project-sam.awardspace.com/


Larry

unread,
Apr 13, 2009, 9:45:12 AM4/13/09
to phpsam
Hi Ian,

Thanks for the response. It is very much appreciated.

I'm actually the developer and the one trying to use SAM. We work for
Sprint and our company uses MQ Series v6.x. I have an application
written in PHP that is trying to connect to the MQ server farm to send/
receive messages for our internal ticketing system. Most of our
applications in Sprint use a Java API but since this application was
written in PHP, we really want to make it work using SAM if possible.

I had my SA install all of the required packages (or at least what we
thought was correct) on our development app server which is a Linux
box. After doing so, he was able to test successfully that the MQ
Client was successfully installed. He was able to connect to the MQ
Mgr and put / get messages on the queue that was set up for us to use.
However, we are unable to get the PHP part working. He installed the
support pac IA94 located here ... http://www-01.ibm.com/support/docview.wss?uid=swg24007092
as well as the IBM WebShere Client v6.0.2.6 located here ...
http://www-01.ibm.com/support/docview.wss?rs=171&uid=swg24009961&loc=en_US&cs=utf-8&lang=en.
He then set the proper settings to the PHP.ini file as he stated and
even added the following entries ...

[sam]
sam.factory.mqtt=mqtt
sam.factory.wmq=xms
sam.factory.wmq:client=xms
sam.factory.wmq:bindings=xms
sam.factory.wpm=xms
sam.factory.rtt=xms

While stepping through the code and inserting test points, it appears
that when the SAMXMSConnection() is being called from the
sam_factory_xms.php file, it is dying. If I insert an echo "test"
prior to this call, it works but not after.

I tried using the code that is located here
http://cvs.php.net/viewvc.cgi/pecl/sam/tests/sam_test1_wmq_p2p.php?view=markup
... first, changed the connection details, but it didn't work. Then,
to simplify things and only try to establish a connection, I reduced
it to this ...

<?php

//---------------------------------------------------------------
// ERROR CHECKING
//---------------------------------------------------------------
// what messages to report
error_reporting (E_ALL ^ E_NOTICE);

// this function will handle all reported errors
function my_error_handler ($errno, $errstr, $errfile, $errline) {
echo "In $errfile, line: $errline\n<br>$errstr\n<br>";
}

set_error_handler ('my_error_handler');
//---------------------------------------------------------------

echo "Testing MQ Connections<br>";

require_once('/usr/local/lib/php/SAM/php_sam.php');

$conn = new SAMConnection();
$conn->connect(SAM_WMQ, array(SAM_HOST => 'SPBO02DV.test.sprint.com',
SAM_PORT => 1428,
SAM_BROKER => 'SPBO02DV'));

if ($conn->isConnected()) {
echo 'Connection is active.';
} else {
echo 'No active connection!';
}

$msg = new SAMMessage('This is a simple text message');
$msg->header->SAM_REPLY_TO = 'DAN.D1.TRS.REPLY';
$correlid = $conn->send('TRS.MQ_REQUEST_D1', $msg);

if (!$correlid) {
// The Send failed!
echo "Send failed ($conn->errno) $conn->error";
} else {
$resp = $conn->receive('DAN.D1.TRS.REPLY', array(SAM_CORRELID =>
$correlid));
echo $resp;
}

$conn->disconnect();

echo "<br>Done";
?>

If you need to see a copy of our php.ini file or have any other
questions, just let me know. We've spent a great deal of time on this
so far and really hope you can help.

Thank you very much,

Larry

Ian Burnett

unread,
Apr 14, 2009, 4:59:25 PM4/14/09
to php...@googlegroups.com
Larry wrote:
> Hi Ian,
>
> Thanks for the response. It is very much appreciated.
>
> I'm actually the developer and the one trying to use SAM. We work for
> Sprint and our company uses MQ Series v6.x. I have an application
> written in PHP that is trying to connect to the MQ server farm to send/
> receive messages for our internal ticketing system. Most of our
> applications in Sprint use a Java API but since this application was
> written in PHP, we really want to make it work using SAM if possible.
>
> I had my SA install all of the required packages (or at least what we
> thought was correct) on our development app server which is a Linux
> box. After doing so, he was able to test successfully that the MQ
> Client was successfully installed. He was able to connect to the MQ
> Mgr and put / get messages on the queue that was set up for us to use.
> However, we are unable to get the PHP part working. He installed the
> support pac IA94 located here ... http://www-01.ibm.com/support/docview.wss?uid=swg24007092
> as well as the IBM WebShere Client v6.0.2.6 located here ...
> http://www-01.ibm.com/support/docview.wss?rs=171&uid=swg24009961&loc=en_US&cs=utf-8&lang=en.
>
[snipped]

I don't have a similar configuration handy, although I'm back in the
office tomorrow. I must admit I haven't tried this type of setup with
XMS 2.0 (although I have no reason to suspect it won't work).

I'll get a server installed shortly and see what I can come up with.

Reply all
Reply to author
Forward
0 new messages