在服务器出现错误“在非套接字上尝试一个操作”

12312

如题

3461 3 0
3个回答

walkor

截图截全一点吧,family后面看不到了。
另外把你的index.php贴下。

  • 12312 2016-06-28

    错误:Warning:socket_import_stream():unableto obtain socket family [0]:在非套接字上尝试一个操作。
    in D:\web\school_pay\new\Workerman\Worker.php on line 669

    index.php
    /**

    • run with command
    • php start.php start
      */

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

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

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

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

    require_once __DIR__ . '/Workerman/Autoloader.php';

    // 加载所有Applications//start.php,以便启动所有服务
    foreach(glob(__DIR__.'/Applications//start*.php') as $start_file)
    {
    require_once $start_file;
    }
    // 运行所有服务
    Worker::runAll();
    ?>

12312

错误:Warning:socket_import_stream():unableto obtain socket family :在非套接字上尝试一个操作。
in D:\web\school_pay\new\Workerman\Worker.php on line 669

index.php
/**

  • run with command
  • php start.php start
    */

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

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

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

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

require_once __DIR__ . '/Workerman/Autoloader.php';

// 加载所有Applications/*/start.php,以便启动所有服务
foreach(glob(__DIR__.'/Applications/_/start_.php') as $start_file)
{
require_once $start_file;
}
// 运行所有服务
Worker::runAll();
?>

  • 暂无评论
walkor

你的windows版本的Workerman代码和线上的不一致,
669行没有socket_import_stream的调用。
https://github.com/walkor/workerman-for-win/blob/master/Worker.php#L669

重新下载一份代码试下。

windows版本正确的启动姿势是参见 http://www.workerman.net/windows
不是启动你的index.php

  • 12312 2016-06-28

    但是下面2行还是存在socket_import_stream的调用。只是我的版本不同你的而已,或直接我删除了空行

年代过于久远,无法发表回答
🔝