我在linux 环境下用socket.io 出现的问题及处理
Unknown command: cronMessage
Usage: php yourfile [mode]
Commands:
start Start worker in DEBUG mode.
Use mode -d to start in DAEMON mode.
stop Stop worker.
Use mode -g to stop gracefully.
restart Restart workers.
Use mode -d to start in DAEMON mode.
Use mode -g to stop gracefully.
reload Reload codes.
Use mode -g to reload gracefully.
status Get worker status.
Use mode -d to show live status.
connections Get worker connections.
这是出现的第一个问题
解决方案,socket.io类库 提供了windows ,liunx 两种环境监听端口的方法,我出现了这个问题是因为在liunx 环境下使用的windows 监听端口的方法
只用进入项目根目录运行 php start.php start 即可
我又出现的第二个问题 posix_getpid()函数无法找到
运行 yum install php-posix