gatawaywoker启动start.php,没有信息显示,我想请教大家这是什么情况?

momo

启动后就如下显示
[attach]1786[/attach]

启动文件代码,我是放在项目得根目录的
[attach]1787[/attach]
 

3719 6 0
6个回答

blogdaren

这个直接看不出原因的,贴下你启动文件里代码。

  • 暂无评论
momo

第二张图片就是启动的代码
 

<?php
/**
 * run with command
 * php start.php start
 */

ini_set('display_errors', 'on');
use Workerman\Worker;

if(strpos(strtolower(PHP_OS), 'win') === 0)
{
    exit("start.php not support windows, please use start_for_win.bat\n");
}

// 检查扩展
if(!extension_loaded('pcntl'))
{
    exit("Please install pcntl extension. See http://doc3.workerman.net/appendices/install-extension.html\n");
}

if(!extension_loaded('posix'))
{
    exit("Please install posix extension. See http://doc3.workerman.net/appendices/install-extension.html\n");
}

// 标记是全局启动
define('GLOBAL_START', 1);

//echo __DIR__;
//exit();

require_once __DIR__.'/vendor/autoload.php';;

// 加载所有Applications/*/start.php,以便启动所有服务ls

foreach(glob(__DIR__.'/start.php') as $start_file)
{
    require_once $start_file;
}
//require __DIR__.'/start.php';
// 运行所有服务
Worker::runAll();
  • 暂无评论
blogdaren

glob这行代码有问题,start.php 改成 start_*.php,而且子启动文件的路径确保要正确,官方自带的印象是在Applications目录,不管怎样,确保路径正确。

  • 暂无评论
momo

我试了一下,没有效果

  • blogdaren 2019-03-04

    $start_file 是各个服务对应的子启动文件, print 下 $start_file ,先看下是否正确加载了子启动文件。

  • momo 2019-03-05

    @614:十分感谢您的回复

  • blogdaren 2019-03-05

    @5502: 不客气

skc

我的也是这个问题,请问楼主怎么解决的

  • 暂无评论
不败少龙

阿里云或者宝塔添加端口放行,在启动试试

  • 暂无评论
年代过于久远,无法发表回答
🔝