禁用函數檢查

使用這個腳本檢查是否有禁用函數。命令行運行curl -Ss https://www.workerman.net/check | php

如果有提示Function 函數名 may be disabled. Please check disable_functions in php.ini說明workerman依賴的函數被禁用,需要在php.ini中解除禁用才能正常使用workerman。
解除禁用參考如下兩種方法任选其一即可。

方法一:腳本解除

執行腳本 curl -Ss https://www.workerman.net/fix | php 以解除禁用

方法二:手動解除

步驟如下:

1、運行php --ini 找到php cli所使用的php.ini文件位置

2、打開php.ini,找到disable_functions一項解除對應函數的禁用

依賴的函數
使用workerman需要解除以下函數的禁用

stream_socket_server
stream_socket_client
pcntl_signal_dispatch
pcntl_signal
pcntl_alarm
pcntl_fork
posix_getuid
posix_getpwuid
posix_kill
posix_setsid
posix_getpid
posix_getpwnam
posix_getgrnam
posix_getgid
posix_setgid
posix_initgroups
posix_setuid
posix_isatty