easy_swoole安装使用踩坑记录ock fail case Operation not permitted at

1 篇文章 0 订阅

我的是win10下面的centos虚拟机,centos系统是7.8.2003的。php版本和swoole下面启动信息里面有展示。

安装之前要先单独创建一个目录
mkdir easy_sw && cd easy_sw
composer require easyswoole/easyswoole

不然搞得你的根目录乱糟糟的。

运行启动命令报错
php vendor/easyswoole/easyswoole/bin/easyswoole install
php easyswoole start

报错如下:

  ______                          _____                              _
 |  ____|                        / ____|                            | |
 | |__      __ _   ___   _   _  | (___   __      __   ___     ___   | |   ___
 |  __|    / _` | / __| | | | |  \___ \  \ \ /\ / /  / _ \   / _ \  | |  / _ \
 | |____  | (_| | \__ \ | |_| |  ____) |  \ V  V /  | (_) | | (_) | | | |  __/
 |______|  \__,_| |___/  \__, | |_____/    \_/\_/    \___/   \___/  |_|  \___|
                          __/ |
                         |___/
main server                   SWOOLE_WEB
listen address                0.0.0.0
listen port                   9501
ip@enp0s3                     192.168.10.136
worker_num                    8
reload_async                  true
max_wait_time                 3
pid_file                      /mnt/share/easy_sw/Temp/pid.pid
log_file                      /mnt/share/easy_sw/Log/swoole.log
user                          root
daemonize                     false
swoole version                4.5.1
php version                   7.3.18
easy swoole                   3.3.7
develop/produce               develop
temp dir                      /mnt/share/easy_sw/Temp
log dir                       /mnt/share/easy_sw/Log
[2020-06-04 09:35:43][debug][error]:[EasySwoole\Task\Worker bind /mnt/share/easy_sw/Temp/EasySwoole.TaskWorker.1.sock fail case Operation not permitted at file:/mnt/share/easy_sw/vendor/easyswoole/component/src/Process/Socket/AbstractUnixProcess.php line:31]
[2020-06-04 09:35:43][debug][error]:[EasySwoole\Task\Worker bind /mnt/share/easy_sw/Temp/EasySwoole.TaskWorker.0.sock fail case Operation not permitted at file:/mnt/share/easy_sw/vendor/easyswoole/component/src/Process/Socket/AbstractUnixProcess.php line:31]
[2020-06-04 09:35:43][debug][error]:[EasySwoole\Task\Worker bind /mnt/share/easy_sw/Temp/EasySwoole.TaskWorker.2.sock fail case Operation not permitted at file:/mnt/share/easy_sw/vendor/easyswoole/component/src/Process/Socket/AbstractUnixProcess.php line:31]
[2020-06-04 09:35:43][debug][error]:[EasySwoole\Task\Worker bind /mnt/share/easy_sw/Temp/EasySwoole.TaskWorker.3.sock fail case Operation not permitted at file:/mnt/share/easy_sw/vendor/easyswoole/component/src/Process/Socket/AbstractUnixProcess.php line:31]
[2020-06-04 09:35:43][debug][error]:[EasySwoole\EasySwoole\Bridge\BridgeProcess bind /mnt/share/easy_sw/Temp/bridge.sock fail case Operation not permitted at file:/mnt/share/easy_sw/vendor/easyswoole/component/src/Process/Socket/AbstractUnixProcess.php line:31]

根据错误信息排查到是因为没有下面的几个文件,原因是创建socket的时候系统报错Operation not permitted,根本原因是虚拟机共享目录不支持这种操作。
在这里插入图片描述
解决问题:

修改dev.php里面的缓存目录配置,使用linux系统的临时目录即可:
在这里插入图片描述

再次运行,正常。进到缓存目录查看:
在这里插入图片描述
在这里插入图片描述
如果要让外部访问还需要放行9501端口:

firewall-cmd --zone=public --add-port=9501/tcp --permanent
firewall-cmd  --reload

在这里插入图片描述

配置Nginx反向代理

因为swoole不支持完整的htpp协议,所以最好配置一下转发,以便设置域名访问。

server {
    root /mnt/share/xxx;
    server_name easy_dev.xxx.xxx.com;
    location / {
        proxy_http_version 1.1;
        proxy_set_header Connection "keep-alive";
        proxy_set_header X-Real-IP $remote_addr;
        if (!-f $request_filename) {
             proxy_pass http://127.0.0.1:9501;
        }
    }
}
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

SHUIPING_YANG

你的鼓励是我创作的最大动力。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值