首先需要获取到代码
把目录全部赋权限0777 , 防止意外
chmod 0777 -R *
配置nginx文件 ,注意那几个重定向指令
server { listen 80; server_name im.sopans.com; access_log /var/log/nginx/im.sopans.com.access.log main; error_log /var/log/nginx/im.sopans.com.error.log; root /var/www/html/pop-im/pop-web/public; rewrite ^/im/h5 /h5.html; rewrite ^/im/web /web.html; if (!-e $request_filename) { rewrite ^/(.*)$ /index.php?s=$1 last; break; } location / { index index.html index.php; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_split_path_info ^(.+\.php)(/.*)$; fastcgi_param PATH_INFO $fastcgi_path_info; include fastcgi_params; } } ~
直接访问,配置数据库连接信息
安装域名/install.php
开启websocket服务,进入pop-socket目录执行
php start.php -d
然后就可以愉快的聊天了
演示地址:
http://im.sopans.com
有需要代码的可以加我的微信联系