查看php扩展版本
php --ri Show configuration for extension .
例如查看 swoole版本
➜ note-swoole git:(dev) ✗ php --ri swoole
swoole
Swoole => enabled
Author => Swoole Team <team@swoole.com>
Version => 4.3.3
Built => May 16 2019 20:01:37
coroutine => enabled
kqueue => enabled
rwlock => enabled
http2 => enabled
pcre => enabled
zlib => enabled
async_redis => enabled
Directive => Local Value => Master Value
swoole.enable_coroutine => On => On
swoole.display_errors => On => On
swoole.use_shortname => On => On
swoole.unixsock_buffer_size => 262144 => 262144
Qps测试
模拟10个用户,对百度首页发起总共100次请求。
➜ note-swoole git:(dev) ab -n 100 -c 10 http://127.0.0.1:9501/site/index
Swoft
安装
# 使用composer 安装
composer create-project swoft/swoft msgsvr v2.0.6
开发环境扩展安装
1、安装devtool工具
composer require swoft/devtool
这个工具,在上线后可以直接清理掉。
Http服务器启动|关闭
// 启动服务
php bin/swoft http:start
// 守护进程启动
php bin/swoft http:start -d
// 重启
php bin/swoft http:restart
// 重新加载
php bin/swoft http:reload
// 关闭服务
php bin/swoft http:stop
Curl 支持
安装Swoole扩展后,不能和PHP的curl扩展兼容,Swoole 官方封装的 Http client 库,已在多个大型项目中使用。
composer require swlib/saber
1441




被折叠的 条评论
为什么被折叠?



