matyhtf / webim

使用PHP+Swoole实现的网页即时聊天工具
1.78k stars 654 forks source link

执行 php webim_server.php 报错 ps:swoole 扩展已装的 #12

Open xujiajun opened 9 years ago

xujiajun commented 9 years ago

Hi,刚接触swoole ,按照安装步骤。

php webim_server.php

PHP Warning:  cli_set_process_title(): cli_set_process_title had an error: Not initialized correctly in /Users/xujiajun/myPlayground/php-webim/vendor/matyhtf/swoole_framework/libs/Swoole/Console.php on line 57
PHP Stack trace:
PHP   1. {main}() /Users/xujiajun/myPlayground/php-webim/webim_server.php:0
PHP   2. Swoole\Network\Server->run() /Users/xujiajun/myPlayground/php-webim/webim_server.php:31
PHP   3. swoole_server->start() /Users/xujiajun/myPlayground/php-webim/vendor/matyhtf/swoole_framework/libs/Swoole/Network/Server.php:214
PHP   4. Swoole\Network\Server->onMasterStart() /Users/xujiajun/myPlayground/php-webim/vendor/matyhtf/swoole_framework/libs/Swoole/Network/Server.php:214
PHP   5. Swoole\Console::setProcessName() /Users/xujiajun/myPlayground/php-webim/vendor/matyhtf/swoole_framework/libs/Swoole/Network/Server.php:140
PHP   6. cli_set_process_title() /Users/xujiajun/myPlayground/php-webim/vendor/matyhtf/swoole_framework/libs/Swoole/Console.php:57

Warning: cli_set_process_title(): cli_set_process_title had an error: Not initialized correctly in /Users/xujiajun/myPlayground/php-webim/vendor/matyhtf/swoole_framework/libs/Swoole/Console.php on line 57

翻过close 没有我的答案,逛过社区 日志 表示连接已经被关闭了,那又是什么原因?

[2015-09-25 20:43:34 *50585.0]  WARN    swFactoryProcess_finish: session#1 does not exist.
[2015-09-25 20:43:34 *50585.0]  WARN    swFactoryProcess_finish: session#1 does not exist.
[2015-09-25 20:43:38 *50585.0]  swFactoryProcess_finish: session#1 does not exist.WARN  

PS:我的环境:Mac OS X 10.10

望指点,感谢!

iMactool commented 8 years ago

php -m 看看有没有加载swoole扩展,另外是否有多个PHP。 看看phpinfo

如果不是brew install php环境的,比如用mamp的可能就要用PHP的绝对路径执行了。 比如: sudo /Applications/MAMP/bin/php/php5.6.10/bin/php webim_server.php start