linux上部署
找到start_web.php 然后發(fā)現(xiàn)這里需要部署自己的域名等,如下部署
<?php
/**
* This file is part of workerman.
*
* Licensed under The MIT License
* For full copyright and license information, please see the MIT-LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @author walkor<walkor@workerman.net>
* @copyright walkor<walkor@workerman.net>
* @link http://wtbis.cn/
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
use \Workerman\Worker;
use \Workerman\WebServer;
use \GatewayWorker\Gateway;
use \GatewayWorker\BusinessWorker;
use \Workerman\Autoloader;
require_once __DIR__ . '/../../vendor/autoload.php';
// WebServer
$web = new WebServer("http://0.0.0.0:55151");
// WebServer進(jìn)程數(shù)量
$web->count = 2;
// 設(shè)置站點(diǎn)根目錄
//$web->addRoot('www.your_domain.com', __DIR__.'/Web');
//$web->addRoot('http://www.***.top', '/var/www/html/xiaoguo/workerman/vendor/workerman/workerman');
$web->addRoot('http://www.***.top', '/var/www/html/xiaoguo/workerman/');
// 如果不是在根目錄啟動(dòng),則運(yùn)行runAll方法
if(!defined('GLOBAL_START'))
{
Worker::runAll();
}
啟動(dòng)。。。。訪(fǎng)問(wèn) http://www.***.top:55151/ 然后就是404.。。怎么改都沒(méi)用。。。求教
我記得這個(gè)例子不用改任何配置的,直接丟上去就可以訪(fǎng)問(wèn)了。
你這樣設(shè)置了反而錯(cuò)了,都設(shè)置到workerman框架目錄里了
哦哦,謝謝。。。但是我沒(méi)有改任何代碼的情況下界面的確有顯示 但是一直沒(méi)有網(wǎng)頁(yè)的彈出框 提示輸入用戶(hù)名,聊天等功能也沒(méi)法實(shí)現(xiàn) http://chat.workerman.net/ 可以看下這個(gè),然后我就想是不是需要另外設(shè)置什么。。。所以沒(méi)有彈出輸入框可能是因?yàn)槭裁茨亍?。謝謝
恢復(fù)初始設(shè)置后 F12 出現(xiàn) WebSocket connection to 'ws://47.75.54.147:7272/' failed: Error in connection establishment: net::ERR_CONNECTION_TIMED_OUT