zoukankan      html  css  js  c++  java
  • 启动workman stream_socket_server() has been disabled for security reasons

    启动workman报错

    Workerman[start.php] start in DEBUG mode
    stream_socket_server() has been disabled for security reasons in file /home/wwwroot/laykefu/vendor/workerman/workerman/Worker.php on line 2214
    PHP Fatal error:  Uncaught Exception in /home/wwwroot/laykefu/vendor/workerman/workerman/Worker.php:2216
    Stack trace:
    #0 /home/wwwroot/laykefu/vendor/workerman/workerman/Worker.php(646): WorkermanWorker->listen()
    #1 /home/wwwroot/laykefu/vendor/workerman/workerman/Worker.php(504): WorkermanWorker::initWorkers()
    #2 /home/wwwroot/laykefu/vendor/workerman/Config/start.php(37): WorkermanWorker::runAll()
    #3 {main}
      thrown in /home/wwwroot/laykefu/vendor/workerman/workerman/Worker.php on line 2216
    
    Fatal error: Uncaught Exception in /home/wwwroot/laykefu/vendor/workerman/workerman/Worker.php:2216
    Stack trace:
    #0 /home/wwwroot/laykefu/vendor/workerman/workerman/Worker.php(646): WorkermanWorker->listen()
    #1 /home/wwwroot/laykefu/vendor/workerman/workerman/Worker.php(504): WorkermanWorker::initWorkers()
    #2 /home/wwwroot/laykefu/vendor/workerman/Config/start.php(37): WorkermanWorker::runAll()
    #3 {main}
      thrown in /home/wwwroot/laykefu/vendor/workerman/workerman/Worker.php on line 2216
    

    原因是:PHP 把 stream_socket_erver() 函数被禁用了

    解决办法

    找到php.ini文件,查找disable_functions 这个一项中是否禁用了stream_socket_server()这个函数

    find / -name php.ini # 查找php.ini所在位置
    vim /usr/local/php/etc/php.ini # 打开编辑php.ini
    

    按esc键,输入:/stream_socket_server,按n开始查找

    检查函数是不是在 disable_functions 这个一项里面,这一项是禁用方法的意思

    如果有这个函数,则删除掉,按esc键,输入wq保存退出

    重启php-fpm

    service php-fpm restart
    
  • 相关阅读:
    24. Swap Nodes in Pairs
    23. Merge k Sorted Lists
    shell脚本报错:"[: =: unary operator expected"
    一种用 数组元素 指定 所调函数 的方法
    阻塞 非阻塞
    Linux open() 一个函数,两个函数原型
    QT 执行windows cmd 命令并读取结果
    Qt5 escape spaces in path
    获取磁盘的 总容量,空余容量,已用容量 【windows】
    通过进程名称,获取其路径
  • 原文地址:https://www.cnblogs.com/niuben/p/13595874.html
Copyright © 2011-2022 走看看