首页 > IT职业 > IT职场 > 14、Workerman案例1-Http服务
php版本>5.3
workerman版本为3.5.16
采用源码安装Workerman
ip为192.168.0.55
<?php
require_once __DIR__ . ‘/Autoloader.php’;
use WorkermanWorker;
$http_worker = new Worker(“http://0.0.0.0:2345”);
$http_worker->onMessage = function($connection, $data){
$connection->send(“hello world.rn”);
};
Worker::runAll();
php start_http.php start

访问http服务

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/810/viewspace-2822899/ ,如需转载,请注明出处,否则将追究法律责任。