PHP + Swoole 简单聊天室

Php  

Chatroom

PHP + Swoole 开发的简单聊天室demo, 主要是 websockt 的应用 。

环境要求

  • PHP >= 7.0
  • Swoole
  • composer

项目地址

https://github.com/kesixin/Chatroom

安装

  1. git clone https://github.com/kesixin/Chatroom
  2. composer install

启动 websockt

  1. cd ./webim
  2. php webim_server.php

启动 PHP 内置服务器

  1. cd ./public
  2. php -S localhost:8000

浏览器访问 localhost:8000 即可进入聊天

截图

效果图

项目测试地址

http://test.kesixin.xin/ ,由于没开启端口,可能无法运行,需要请联系!



评论 14

发表评论


匿名

1

3年前 ·


测试

测试

4年前 · 广东 广州


阿强

你好,我安装完之后,启动websocket的时候报 /Users/zhouqiang/file/github/ChatroomPHP Fatal error: Uncaught Error: Class 'swoole_table' not found in /Users/zhouqiang/file/github/Chatroom/src/WebSocket.php:117 Stack trace: #0 /Users/zhouqiang/file/github/Chatroom/src/WebSocket.php(17): WebIM\WebSocket->createTable() #1 /Users/zhouqiang/file/github/Chatroom/webim_server.php(5): WebIM\WebSocket->__construct() #2 {main} thrown in /Users/zhouqiang/file/github/Chatroom/src/WebSocket.php on line 117 错误,找了半天没找到,初学者

5年前 · 北京 北京


c

cicada chirp

厉害

5年前 · 河北 石家庄


S

Sean

好厉害!

5年前 · 北京 北京


s

squid

不错哦,刚想学学

5年前 · 浙江 杭州


愚公

值得一赞

6年前 · 广东 广州


K

Korean

可以看一下吗?

6年前 · 广东 广州

Mamba 博主

回复 Korean:可以啊

6年前 · 广东 广州

Mamba 博主

回复 Korean:可以了

6年前 · 广东 广州

1

1

回复 Mamba:31

4年前 · 上海 上海

1

1

回复 1:31

4年前 · 上海 上海

Top