zoukankan      html  css  js  c++  java
  • swoole 进阶

    1.cygwin 安装swoole 报错致命错误:pcre2.h:No such file or directory

    make install 时报错 

    In file included from /home/swoole-src-4.4.14/swoole.cc:20:0:
    /usr/include/php/ext/pcre/php_pcre.h:27:10: 致命错误:pcre2.h:No such file or directory
     #include "pcre2.h"
              ^~~~~~~~~
    编译中断。
     

    显然是缺少 pcre2

    重新安装 cygwin   ,其他插件保持keep

    安装 pcre2  等 相关插件即可;

    Install libpcre2-devel 

    Install libpcre-devel

     2.TCP 服务器

    • 服务器可以同时被成千上万个客户端连接,$fd 就是客户端连接的唯一标识符
    • 调用 $server->send() 方法向客户端连接发送数据,参数就是 $fd 客户端标识符
    • 调用 $server->close() 方法可以强制关闭某个客户端连接
    • 客户端可能会主动断开连接,此时会触发 onClose 事件回调

    3.查看已安装的swoole的版本

    php --ri swoole

     4.windows下用Cygwin64 Terminal启动swoole的时候,运行php server.php的时候报错:

    PHP Warning: swoole_set_process_name(): cli_set_process_title had an error: Not available on this OS in /home/swoole-src-4.6.2/examples/server.php on line 134

    一直就纠结为什么提示不支持os系统。
    结果发现是目录进错了应该是运行/examples/http下面的server.php

    5.测试成功

    6.swoole调试由于开启了进程守护,导至报错

     1 查看我的 swoole 监听端口号 9501

      netstat -anp  | grep  9501

    image.png

    关掉进行

    kill -9 29854

    29854 就是我图中的

    参考; https://www.jianshu.com/p/ee5abbaf6b17

    https://blog.csdn.net/gulicms/article/details/96299989

  • 相关阅读:
    python3中内置函数map 和 reduce函数的使用
    爬山算法和模拟退火算法
    Link-Cut Tree(LCT)
    启发式搜索——A*算法
    树上分块
    CodeChef TRIPS-Children Trips 树上分块
    CodeChef:Chef and Problems(分块)
    莫队算法
    Konig定理及证明
    块状链表
  • 原文地址:https://www.cnblogs.com/lxwphp/p/15452450.html
Copyright © 2011-2022 走看看