【发布时间】:2018-02-25 02:12:19
【问题描述】:
我已经在 WAMP 中成功安装了 ZeroMQ,请看下面的截图。
但是我得到了错误:
致命错误:未捕获的错误:在 C:\wamp64\www\0MQ\zguide\examples\PHP\hwclient.php:9 中找不到类 'ZMQContext' 堆栈跟踪:#0 {main} 在 C:\wamp64 中抛出\www\0MQ\zguide\examples\PHP\hwclient.php 在第 9 行
当我在浏览器中运行测试脚本时:
测试脚本:
<?php
/*
* Hello World client
* Connects REQ socket to tcp://localhost:5555
* Sends "Hello" to server, expects "World" back
* @author Ian Barber <ian(dot)barber(at)gmail(dot)com>
*/
$context = new ZMQContext();
// Socket to talk to server
echo "Connecting to hello world server...\n";
$requester = new ZMQSocket($context, ZMQ::SOCKET_REQ);
$requester->connect("tcp://localhost:5555");
for ($request_nbr = 0; $request_nbr != 10; $request_nbr++) {
printf ("Sending request %d...\n", $request_nbr);
$requester->send("Hello");
$reply = $requester->recv();
printf ("Received reply %d: [%s]\n", $request_nbr, $reply);
}
我该如何处理?
【问题讨论】:
-
您能否开始安装检查程序,从可达性测试开始,并打印调用
void zmq_version( &major, &minor, &patch )的实际输出? -
@user3666197 请概述要遵循的步骤。我刚刚开始学习这个
-
@user3666197,我运行了这个脚本来检查是否安装了 zeromq 并告诉我版本
<?php if (class_exists("ZMQ") && defined("ZMQ::LIBZMQ_VER")) { echo ZMQ::LIBZMQ_VER, PHP_EOL; }我得到了 **4.1.3 **
标签: php zeromq failed-installation