GithubHelp home page GithubHelp logo

webim's People

Contributors

matyhtf avatar xuhaixiao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

webim's Issues

Web Server无法访问

http://127.0.0.1:8888/main.html

我的配置如下

'127.0.0.1', //监听的端口 'port' => '9503', //WebSocket的URL地址,供浏览器使用的 'url' => 'ws://127.0.0.1:9503', //用于Comet跨域,必须设置为html所在的URL 'origin' => 'http://127.0.0.1:8888', ); $config['swoole'] = array( 'log_file' => **DIR**.'/log/swoole.log', 'worker_num' => 1, //不要修改这里 'max_request' => 0, 'task_worker_num' => 1, //是否要作为守护进程 'daemonize' => 0, ); $config['webim'] = array( //聊天记录存储的目录 'data_dir' => **DIR**.'/data/', 'log_file' => **DIR**.'/log/webim.log', ); return $config;

vendor 在哪里啊

PHP Fatal error: require(): Failed opening required '/var/www/swooleim/vendor/autoload.php' (include_path='.:/usr/share/pear:/usr/share/php') in /var/www/swooleim/webim_server.php on line 5

Storage/Redis not found

运行
php webim_server.php start

Notice: Undefined index: storage in ~/webim/src/Server.php on line 51

PHP Fatal error:  Uncaught Error: Class 'Redis' not found in ~/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Component/Redis.php:83

求解是什么问题呢~

Swoole \ Exception \ NotFound

一直报这个问题,想请教一下怎么解决呢
Swoole \ Exception \ NotFound
Swoole\Factory: resource[cache/session] not found.

config IP填写

这个host IP如何填写? 我是在服务器上配置的

启动访问登录后404错误

404 Not Found
Swoole\Factory: resource[cache/session] not found.

SwooleFramework at 127.0.0.1 Port 8888

#0 line:383 call:Swoole\Error::info file:/Users/test/swoole/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Protocol/HttpServer.php
#1 line:642 call:Swoole\Protocol\HttpServer->httpError file:/Users/test/swoole/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Swoole.php
#2 line:47 call:Swoole->handlerServer file:/Users/test/swoole/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Protocol/AppServer.php
#3 line:262 call:Swoole\Protocol\AppServer->onRequest file:/Users/test/swoole/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Protocol/HttpServer.php
#4 line:0 call:Swoole\Protocol\HttpServer->onReceive file:unknow
#5 line:405 call:swoole_server->start file:/Users/test/swoole/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Network/Server.php
#6 line:33 call:Swoole\Network\Server->run file:/Users/test/swoole/webim/webroot/webserver_for_im.php

/usr/sbin/httpd2-config always missing

Hi,
Im using cygwin for windows but i always get error like this.

$ /usr/sbin/httpd2-config
/usr/sbin/httpd2-config: line 20: /usr/sbin/apxs2: No such file or directory
/usr/sbin/httpd2-config: line 21: /usr/sbin/apxs2: No such file or directory
/usr/sbin/httpd2-config: line 22: /usr/sbin/apxs2: No such file or directory
chmod: cannot access '': No such file or directory
setfacl: No such file or directory
chmod: cannot access '': No such file or directory
setfacl: No such file or directory

*** Warning: The following function requires administrator privileges!
*** Query: Do you want to install httpd2 as service? (yes/no) yes
cygrunsrv: Given path doesn't point to a valid executable
Try `cygrunsrv --help' for more information.

Configuration finished. Have fun!

$ apt-cyg -m ftp://ftp.cygwinports.org/pub/cygwinports/ install apache2
Working directory is /setup
Mirror is ftp://ftp.cygwinports.org/pub/cygwinports/
--2016-04-13 16:22:31-- ftp://ftp.cygwinports.org/pub/cygwinports//x86_64/setup
.bz2
=> `.listing'
Resolving ftp.cygwinports.org (ftp.cygwinports.org)... 209.132.180.131
Connecting to ftp.cygwinports.org (ftp.cygwinports.org)|209.132.180.131|:21... c
onnected.
Logging in as anonymous ... Logged in!
==> SYST ... done. ==> PWD ... done.
==> TYPE I ... done. ==> CWD (1) /pub/cygwinports//x86_64 ... done.
==> PASV ... done. ==> LIST ... done.

.listing [ <=> ] 584 --.-KB/s in 0s

2016-04-13 16:22:38 (4.46 MB/s) - `.listing' saved [584]

Removed .listing'. --2016-04-13 16:22:38-- ftp://ftp.cygwinports.org/pub/cygwinports//x86_64/setup .bz2 =>setup.bz2'
==> CWD not required.
==> PASV ... done. ==> RETR setup.bz2 ... done.
Length: 592838 (579K)

setup.bz2 100%[===================>] 578.94K 31.4KB/s in 35s

2016-04-13 16:23:14 (16.6 KB/s) - `setup.bz2' saved [592838]

Updated setup.ini
Package apache2 is already installed, skipping

根据文档配置nginx,不使用域名,使用ip地址,配完nginx,访问时返回File not found.

访问http::// 180.76.128.198:8084 返回File not found.
这个是什么问题引起的?
nginx 配置如下
server {
listen 8084;
server_name 180.76.128.198;
index index.html index.php;

access_log  /path/to/webim/webroot/access.log  main;
error_log /path/to/webim/webroot/error.log warn;


location / {
    root   /path/to/webim/webroot;
    proxy_set_header X-Real-IP $remote_addr;
    if (!-e $request_filename) {
        rewrite ^/(.*)$ /index.php;
    }
}

location ~ .*\.(php|php5)?$ {
fastcgi_pass  127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
    include        fastcgi_params;
    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

}

会报一下错误,但是没发现影响正常使用!~~

PHP Notice: Undefined index: storage in /www/web/webim_baidu_com/public_html/src/Server.php on line 51
PHP Notice: Undefined offset: 2 in /www/web/webim_baidu_com/public_html/src/Server.php on line 197
PHP Warning: Swoole\Database\MySQLi SQL Error:


select * from webim_history order by webim_history.id desc limit 100

Server: localhost:3306.

Message:

Errno: 0
in /www/web/webim_baidu_com/public_html/vendor/matyhtf/swoole_framework/libs/Swoole/Database/MySQLi.php on line 157
PHP Warning: Invalid argument supplied for foreach() in /www/web/webim_baidu_com/public_html/src/Storage.php on line 104
PHP Notice: Undefined offset: 5 in /www/web/webim_baidu_com/public_html/src/Server.php on line 197
PHP Warning: Swoole\Database\MySQLi SQL Error:
insert into webim_history (name,avatar,msg,type) values('baidu','http://www.swoole.com/static/images/default.png','{\"cmd\":\"message\",\"from\":5,\"channal\":0,\"data\":\"\\u58eb\\u5927\\u592b\\u8bf4\\u7684\",\"type\":\"text\"}','text')

Server: localhost:3306.

Message:

Errno: 0
in /www/web/webim_baidu_com/public_html/vendor/matyhtf/swoole_framework/libs/Swoole/Database/MySQLi.php on line 157

聊天记录里的用户 全部变成 undefined了 ,用户信息没有保存下来

【历史记录】undefined对大家说:do
16:56:01
【历史记录】undefined对大家说:ataa
16:56:07
【历史记录】undefined对大家说:kaokao
16:57:11
【历史记录】undefined对大家说:kaokao
16:57:29
【历史记录】undefined对大家说:sdf
16:57:31
【历史记录】undefined对大家说:myqsadf
16:57:38
【历史记录】undefined对大家说:ppp
16:57:42
【历史记录】undefined对大家说:why
17:02:07

聊天记录文件里存的信息为

{"user":false,"msg":{"cmd":"message","from":1,"channal":0,"data":"do","type":"text"},"time":1440147361,"type":"text"}
{"user":false,"msg":{"cmd":"message","from":1,"channal":0,"data":"ataa","type":"text"},"time":1440147367,"type":"text"}
{"user":false,"msg":{"cmd":"message","from":2,"channal":0,"data":"kaokao","type":"text"},"time":1440147431,"type":"text"}
{"user":false,"msg":{"cmd":"message","from":3,"channal":0,"data":"kaokao","type":"text"},"time":1440147449,"type":"text"}
{"user":false,"msg":{"cmd":"message","from":3,"channal":0,"data":"sdf ","type":"text"},"time":1440147451,"type":"text"}
{"user":false,"msg":{"cmd":"message","from":2,"channal":0,"data":"myqsadf","type":"text"},"time":1440147458,"type":"text"}
{"user":false,"msg":{"cmd":"message","from":2,"channal":0,"data":"ppp","type":"text"},"time":1440147462,"type":"text"}
{"user":false,"msg":{"cmd":"message","from":4,"channal":0,"data":"why","type":"text"},"time":1440147727,"type":"text"}

一个新用户刚上去的时候聊天室友名字的,退出后,就全部变成undefined了

php webim_server.php start 出现错误,求解

PHP Notice: Undefined index: storage in /usr/local/src/webim/src/Server.php on line 51
PHP Fatal error: Uncaught Error: Class 'Redis' not found in /usr/local/src/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Component/Redis.php:79
Stack trace:
#0 /usr/local/src/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Component/Redis.php(72): Swoole\Component\Redis->connect()
#1 /usr/local/src/webim/vendor/matyhtf/swoole_framework/libs/factory/redis.php(25): Swoole\Component\Redis->__construct(Array)
#2 /usr/local/src/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Swoole.php(513): require('/usr/local/src/...')
#3 /usr/local/src/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Swoole.php(469): Swoole->loadModule('redis')
#4 /usr/local/src/webim/src/Storage.php(15): Swoole->__get('redis')
#5 /usr/local/src/webim/src/Server.php(51): WebIM\Storage->__construct(NULL)
#6 /usr/local/src/webim/webim_server.php(32): WebIM\Server->__construct(Array)
#7 /usr/local/src/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Network/Server.php(195): {closure}(Array)
#8 /usr/local/src/webim/webim_server.php(42): Swoole\Network\Ser in /usr/local/src/webim/vendor/matyhtf/swoole_framework/libs/Swoole/Component/Redis.php on line 79

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

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

望指点,感谢!

可以把使用redis做为存储, 可配置化么?

我看代码现在写死了。 我使用mac对代码进行测试,根本没有可跑通的可能。

    /**
     * 使用文件或redis存储聊天信息
     */
    $this->setStore(new \WebIM\Store\File($config['webim']['data_dir']));
    $this->origin = $config['server']['origin'];

Uncaught exception 'Swoole\Exception\Factory' with message 'log->master is not found.'

swoole

swoole support => enabled
Version => 2.0.7
Author => tianfeng.han[email: [email protected]]
kqueue => enabled
rwlock => enabled
async http/websocket client => enabled
pcre => enabled
zlib => enabled

Directive => Local Value => Master Value
swoole.aio_thread_num => 2 => 2
swoole.display_errors => On => On
swoole.use_namespace => On => On
swoole.fast_serialize => Off => Off
swoole.unixsock_buffer_size => 8388608 => 8388608

swoole-1.7.9 增加了内置的websocket服务器支持

看源码websocket服务器是基于swoole扩展提供的swoole_http_server用PHP实现的,是否可以改造成用swoole-1.7.9以后内置的swoole_websocket_server?这样websocket的帧解析、打包等字符串处理就可以交给效率高很多的C去处理,会提高不少性能

是php版本太低了吗? 我的php是5.3.3

Can't inherit abstract function Swoole\IFace\Log::put() (previously declared abstract in Swoole\Log) in /var/www/sw_chat/vendor/matyhtf/swoole_framework/libs/Swoole/Log/FileLog.php on line 9

mac系统和服务器上都无法composer install

composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1

  • The requested package matyhtf/swoole_framework dev-master exists as matyhtf/swoole_framework[1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.1.0, 1.1.1, 1.1.2, 1.10.0, 1.11.0, 1.11.1, 1.11.2, 1.12.0, 1.13.0, 1.13.1, 1.13.2, 1.13.3, 1.13.4, 1.13.5, 1.13.6, 1.14.0, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.2.0, 1.20.2, 1.20.3, 1.20.4, 1.20.5, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.6.1, 1.6.10, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.6.8, 1.6.9, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 1.8.0, 1.8.1, 1.8.10, 1.8.11, 1.8.12, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.8.8, 1.8.9, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5, 1.9.6, 1.9.7, 1.9.8, dev-origin/master, v2.0.0] but these are rejected by your constraint.

IE的flash_websocket怎么连接

chat.js 里面有这个判断:
//使用flash websocket
else if (webim.flash_websocket)
{
WEB_SOCKET_SWF_LOCATION = "/static/flash-websocket/WebSocketMain.swf";

但是没找到在哪定义的webim.flash_websocket,所以flash_websocket一直无法使用

php webim_server.php 运行出以下错误,求解!

Notice: Use of undefined constant SWOOLE_PROCESS - assumed 'SWOOLE_PROCESS' in D
:\wamp\www\php-webim-master\webim_server.php on line 29

Call Stack:
0.0000 234304 1. {main}() D:\wamp\www\php-webim-master\webim_server.ph
p:0

Notice: Use of undefined constant SWOOLE_SOCK_TCP - assumed 'SWOOLE_SOCK_TCP' in
D:\wamp\www\php-webim-master\vendor\matyhtf\swoole_framework\libs\Swoole\Networ
k\Server.php on line 44

Call Stack:
0.0000 234304 1. {main}() D:\wamp\www\php-webim-master\webim_server.ph
p:0
0.0230 1473584 2. Swoole\Network\Server->__construct() D:\wamp\www\php-
webim-master\webim_server.php:29

Fatal error: Class 'swoole_server' not found in D:\wamp\www\php-webim-master\ven
dor\matyhtf\swoole_framework\libs\Swoole\Network\Server.php on line 45

Call Stack:
0.0000 234304 1. {main}() D:\wamp\www\php-webim-master\webim_server.ph
p:0
0.0230 1473584 2. Swoole\Network\Server->__construct() D:\wamp\www\php-
webim-master\webim_server.php:29

composer install 执行报错

oading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

Problem 1
- The requested package matyhtf/swoole_framework dev-master exists as matyhtf/swoole_framework[1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.1.0, 1.1.1, 1.1.2, 1.10.0, 1.11.0, 1.11.1, 1.11.2, 1.12.0, 1.13.0, 1.13.1, 1.13.2, 1.13.3, 1.13.4, 1.13.5, 1.13.6, 1.14.0, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.2.0, 1.20.2, 1.20.3, 1.20.4, 1.20.5, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.6.1, 1.6.10, 1.6.2, 1.6.3, 1.6.4, 1.6.5, 1.6.6, 1.6.7, 1.6.8, 1.6.9, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.7.4, 1.7.5, 1.7.6, 1.7.7, 1.8.0, 1.8.1, 1.8.10, 1.8.11, 1.8.12, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.8.8, 1.8.9, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5, 1.9.6, 1.9.7, 1.9.8] but these are rejected by your constraint.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.