search
Homephp教程php手册在centos下处理PHP+WebSphere客户端

事先申明。我是借鉴了这篇博客:http://blog.phpdeveloper.org/?p=140 当然在其中遇到了不少问题,我在这里一一说明: 1、准备工作 a. pecl mqseries :http://pecl.php.net/package/mqseries b. ibm mq client:http://www-01.ibm.com/software/integration/

 事先申明。我是借鉴了这篇博客:http://blog.phpdeveloper.org/?p=140

当然在其中遇到了不少问题,我在这里一一说明:

1、准备工作

a. pecl mqseries :http://pecl.php.net/package/mqseries

b. ibm mq client: http://www-01.ibm.com/software/integration/wmq/clients/

2、步骤:

1、先安装ibm mq client :下载地址最终是要翻墙的,我这里不教翻墙技术。下载完后,解开压缩,在centos下面,直接rpm -ivh 
   MQSeriesRuntime-7.5.0-3.x86_64.rpm,和rpm -ivh MQSeriesSDK-7.5.0-3.x86_64.rpm ,由于我们只是当成一个client库来连接,因此安装这两个就够了

2、编译mqseries。在这里我吃药了,我下载的是0.14版的,我一看更新时间是2014年。我想这是最新的总没问题吧。结果。。。./configure到最后的时候,说--with-libdir=lib64找不到,让我指定。可是我明明指定了也不能安装。于是google了一下,发现这曾经是一个BUG。在2012年解决掉了。在bug.php.net里。写的是bug fixed。所以我下载了0.13的,然后再安装,果然成功了

3、测试

    <?php ??
    $mq_host_ip?????????='127.0.0.1';??
    $queue_name?????=?'HOST.REMOTE.Q';??
    $mq_server??????=?'WBRK_QM_U49';??
    $mqcno?=?array(??
    ????????'Version'?=>?MQSERIES_MQCNO_VERSION_2,??
    ????????'Options'?=>?MQSERIES_MQCNO_STANDARD_BINDING,??
    ????????'MQCD'?=>?array(??
    ????????????????'ChannelName'???????????????????=>?'CLIENT.CHANNEL',??
    ????????????????'ConnectionName'????????????????=>?$mq_host_ip,??
    ????????????????'TransportType'?????????????????=>?MQSERIES_MQXPT_TCP??
    ????????)??
    );??
    ??
    //?Connect?to?the?MQ?server??
    mqseries_connx($mq_server,$mqcno,$conn,$comp_code,$reason);??
    if?($comp_code?!==?MQSERIES_MQCC_OK)?{??
    ????????trigger_error('Cannot?open?connection?to?server:?'.$mq_server,E_USER_ERROR);??
    }else{??
    ??????echo?'Connection?good!';??
    }??
$mq_server从手册上看得知这应该是:queue_manager,所以应该是manager的名称

如果你访问的mq不是默认的端口号,还要加上端口号。我在这里走了不少弯路。我原来connectionName是写成:127.0.0.1:1234,报错2387,意思是host not avarible。查了下资料,原来端口号应该是 ip(port),也就是说得:127.0.0.1(1234) 这样的形式才OK。于是改好后再测试就通过啦。

----

我是在一台干净的Centos上安装的。所以做了很多准备工作:

1、 yum install php php-devel(devel里面才有phpize)

2、yum install gcc gcc-c++ g++

然后在安装的时候还有提示:you will need re2c ...于是找到这个博客:http://denghai260.blog.163.com/blog/static/726864092012260242533/

里面说道:

    wget?http://sourceforge.net/projects/re2c/files/re2c/0.13.5/re2c-0.13.5.tar.gz/download??
    tar?-zxvf?re2c-0.13.5.tar.gz??
    cd?re2c-0.13.5??
    ./configure?&&?make?&&?make?install??

至此,遇到的所有的问题都解决了。

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

VSCode Windows 64-bit Download

VSCode Windows 64-bit Download

A free and powerful IDE editor launched by Microsoft

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment