walkor / workerman

An asynchronous event driven PHP socket framework. Supports HTTP, Websocket, SSL and other custom protocols.
http://www.workerman.net
MIT License
11.18k stars 2.27k forks source link

Unable to start ? #609

Closed eduwebconsulting closed 3 years ago

eduwebconsulting commented 3 years ago
Workerman version:3.5.6          PHP version:7.3.15
------------------------ WORKERS -------------------------------
worker               listen                              processes status
PHPSocketIO          socketIO://0.0.0.0:2120             1         [ok]
PHP Fatal error:  Declaration of Workerman\Events\React\Base::cancelTimer(React
\EventLoop\TimerInterface $timer) must be compatible with React\EventLoop\LoopI
nterface::cancelTimer(React\EventLoop\Timer\TimerInterface $timer) in C:\xampp\
htdocs\my-website\vendor\workerman\workerman\Events\React\Base.php on line 24
walkor commented 3 years ago

Try to run command.

composer remove react/event-loop
eduwebconsulting commented 3 years ago

composer remove react/event-loop

Its not even in composer.json

{
    "name": "yiisoft/mywebsite",
    "description": "classTrack",
    "authors": [

    ],
    "keywords": [
        "yii2"
    ],
    "homepage": "http://www.yiiframework.com/",
    "type": "project",
    "license": "BSD-3-Clause",
    "support": {
        "issues": "https://github.com/yiisoft/yii2/issues?state=open",
        "forum": "http://www.yiiframework.com/forum/",
        "wiki": "http://www.yiiframework.com/wiki/",
        "irc": "irc://irc.freenode.net/yii",
        "source": "https://github.com/yiisoft/yii2"
    },
    "minimum-stability": "stable",
    "require": {
        "php": ">=7.0.0",
        "yiisoft/yii2": "*",
        "yiisoft/yii2-swiftmailer": "*",
        "yiisoft/yii2-jui": "*",
        "yiisoft/yii2-imagine": "*",
        "yiisoft/yii2-authclient": "*",
        "sunhater/kcfinder": "dev-master",
        "iutbay/yii2-kcfinder": "dev-master",
        "iutbay/yii2-fontawesome": "dev-master",
        "2amigos/yii2-ckeditor-widget": "*",
        "2amigos/yii2-date-picker-widget": "*",
        "2amigos/yii2-date-time-picker-widget": "*",
        "miloschuman/yii2-highcharts-widget": "*",
        "kartik-v/yii2-widget-rating": "*",
        "kartik-v/yii2-widget-fileinput": "*",
        "himiklab/yii2-sortable-grid-view-widget": "*",
        "bryglen/yii2-apns-gcm": "*",
        "kartik-v/yii2-mpdf": "*",
        "perminder-klair/yii2-dropzone": "dev-master",
        "kartik-v/yii2-widget-datepicker": "@dev",
        "pheme/yii2-jui-timepicker": "*",
        "guzzlehttp/guzzle": ">=4.1.4 <7.0",
        "zgb7mtr/yii2-bootstrap-color-picker": "~1.0",
        "2amigos/yii2-editable-widget": "~1.0",
        "kartik-v/yii2-widget-timepicker": "*",
        "kartik-v/yii2-date-range": "^1.7",
        "mpdf/mpdf": "^7.1",
        "2amigos/yii2-grid-view-library": "~1.0",
        "kartik-v/yii2-widget-select2": "@dev",
        "phpoffice/phpspreadsheet": "*",
        "kartik-v/yii2-widget-depdrop": "@dev",
        "loveorigami/yii2-bootstrap-toggle": "*",
        "yiisoft/yii2-bootstrap4": "^2.0",
        "lesha724/yii2-document-viewer": "*",
        "kartik-v/yii2-field-range": "dev-master",
        "shuchkin/simplexlsx": "^0.8.10",
        "kartik-v/yii2-editable": "@dev",
        "kartik-v/yii2-export": "@dev",
        "kartik-v/yii2-bootstrap4-dropdown": "@dev",
        "borales/yii2-phone-input": "*",
        "linslin/yii2-curl": "*",
        "lajax/yii2-language-picker": "^1.2",
        "devgroup/yii2-jsoneditor": "*",
        "yiisoft/yii2-queue": "~2.3",
        "bizley/contenttools": "^1.5",
        "yii2mod/yii2-editable": "*",
        "bryglen/yii2-omnipay": "1.0.0",
        "kartik-v/yii2-checkbox-x": "^1.0",
        "sjaakp/yii2-telex": "*",
        "2amigos/qrcode-library": "~1.1",
        "kartik-v/yii2-widget-colorinput": "*",
        "froala/yii2-froala-editor": "^3.1",
        "onmotion/yii2-survey": "^0.1.4",
        "kartik-v/yii2-widget-typeahead": "*",
        "marekpetras/yii2-ajax-box-widget": "^1.0",
        "eddmash/yii2-clipboard": "@dev",
        "kit-tools/yii2-webui-popover": "dev-master",
        "onmotion/yii2-page-assessments": "^1.1",
        "kartik-v/yii2-popover-x": "dev-master",
        "kartik-v/yii2-detail-view": "dev-master",
        "cinghie/yii2-cookie-consent": "^1.5.1",
        "kartik-v/yii2-widget-growl": "dev-master",
        "diiimonn/yii2-widget-checkbox-multiple": "dev-master",
        "2amigos/yii2-multi-select-widget": "*",
        "newerton/yii2-fancybox": "dev-master",
        "demogorgorn/yii2-ajax-submit-button": "*",
        "simialbi/yii2-elfinder": "^1.6",
        "jcrowe/bad-word-filter": "2.2.*",
        "jwaldock/yii2-ajaxform": "dev-master",
        "hoaaah/yii2-ajaxcrud-bs4": "*",
        "ianikanov/yii2-wce": "dev-master",
        "mootensai/yii2-enhanced-gii": "dev-master",
        "coderius/yii2-hit-counter": "1.0.2.2",
        "tomlutzenberger/yii2-smartsupp-chat": "*",
        "vxm/yii2-desktop-notifier": "^1.0",
        "trntv/probe": "dev-master",
        "perminder-klair/yii2-videojs": "dev-master",
        "inquid/yii2-signature": "dev-master",
        "kriss/yii2-log-reader": "2.*",
        "unclead/yii2-multiple-input": "~2.0",
        "aminkt/yii2-input-tag-widget": "@dev",
        "kartik-v/yii2-sortable-input": "dev-master",
        "richardfan1126/yii2-sortable-gridview": "*",
        "ext-json": "*",
        "yiisoft/yii2-sphinx": "^2.0",
        "wbraganca/yii2-multiselect": "~1.0.1",
        "wbraganca/yii2-dynamicform": "*",
        "yiisoft/yii2-redis": "~2.0.0",
        "dmstr/yii2-json-editor": "^1.0",
        "opentok/opentok": "4.4.x",
        "sjaakp/yii2-collapse": "^1.1",
        "buttflattery/yii2-videowall": "@dev",
        "daxslab/yii2-localeurls": "^1.0",
        "codemix/yii2-localeurls": "^1.7",
        "sendgrid/sendgrid": "~7",
        "rustici-software/scormcloud-api-v2-client-php": "^1.1",
        "llagerlof/moodlerest": "2.3.0",
        "kop/yii2-scroll-pager": "dev-master",
        "buttflattery/yii2-formwizard": "@dev",
        "quickbooks/v3-php-sdk": "^6.0",
        "sjaakp/yii2-alphapager": "*",
        "skeeks/yii2-assets-auto-compress": "*",
        "kartik-v/yii2-password": "@dev",
        "daxslab/yii2-calendly": "*",
        "kartik-v/yii2-tree-manager": "dev-master",
        "vxm/yii2-js-params": "^1.0",
        "timurmelnikov/yii2-loading-overlay": "~1.0.0",
        "kartik-v/yii2-nav-x": "@dev",
        "yii2mod/yii2-cart": "*",
        "pceuropa/yii2-forms": "^3.0",
        "meysampg/yii2-formbuilder": "*",
        "yii2mod/yii2-sweet-alert": "*",
        "yidas/yii2-bower-asset": "2.0.13.1",
        "simialbi/yii2-kanban": "^1.6",
        "hubspot/api-client": "^2.3",
        "hubspot/hubspot-php": "^3.0",
        "cranky4/change-log-behavior": "*",
        "hyperia/yii2-secure-headers": "^1.0",
        "kartik-v/yii2-editors": "@dev",
        "kartik-v/yii2-icons": "@dev",
        "himiklab/yii2-recaptcha-widget": "*",
        "floor12/yii2-notification": "^1.3",
        "vatandoost/filemanager": "dev-master",
        "xstreamka/yii2-mobile-detect": "*",
        "bp-sys/yii2-aws-s3": "~2.0",
        "zantknight/yii2-cam-capture": "*",
        "johnson/yii2-webcam": "*",
        "zantknight/yii2-gallery4": "*",
        "davidjeddy/yii2-rss-reader": "*",
        "coderius/yii2-jqcloud2-widget": "@dev",
        "kriss/yii2-web-msg-sender": "*",
        "beaten-sect0r/yii2-flatpickr": "*",
        "lesha724/yii2-youtube-widget": "*",
        "philippfrenzel/yii2bsduallistbox": "*",
        "tuyakhov/yii2-notifications": "v1.2.1",
        "demi/dropbox-backup": "~2.0",
        "demi/backup": "~1.0",
        "hauntd/yii2-vote": "0.3.*",
        "branchonline/yii2-joyride": "1.0",
        "omnilight/yii2-vuejs": "^1.0",
        "toriphes/yii2-widget-lazyload": "*",
        "loveorigami/yii2-scrollup-widget": "*",
        "drsdre/yii2-add-to-homescreen": "*",
        "programmis/yii2-socket-chat": "^0.0.9",
        "2amigos/yii2-chartjs-widget": "~2.0",
        "kartik-v/yii2-context-menu": "dev-master",
        "phpoffice/phpword": "^0.17.0",
        "thecodeholic/yii2-grapesjs": "^v0.1.0",
        "creocoder/yii2-flysystem": "^1.0",
        "kdn/yii2-json-editor": "*",
        "kllakk/yii2-quizzes": "*",
        "ruskid/yii2-stripe": "dev-master",
        "stripe/stripe-php": "^7.69",
        "codemix/yii2-excel-message": "^1.1",
        "kartik-v/yii2-ipinfo": "dev-master",
        "mikk150/yii2-iframe-resizer": "^1.0",
        "neodev3/yii2-website-viewer": "^1.0",
        "vxm/yii2-mfa": "^1.0",
        "fedemotta/yii2-widget-datatables": "*",
        "kartik-v/yii2-datecontrol": "dev-master",
        "mzk10k/yii2-tcpdf": "dev-master",
        "pahanini/yii2-consolelog": "*",
        "nullref/yii2-datatables": "^1.1",
        "thamtech/yii2-uuid": "^1.2",
        "trntv/yii2-aceeditor": "^2.1",
        "kak/colorpicker": "*",
        "thyseus/yii2-message": "^0.4.2",
        "smalot/pdfparser": "^0.18.2",
        "gufy/pdftohtml-php": "~2",
        "google/cloud-translate": "^1.10",
        "execut/yii2-autosize-textarea": "dev-master",
        "jcobhams/newsapi": "^1.0",
        "wdmg/yii2-media": "^1.0",
        "wdmg/yii2-selectinput": "^1.0",
        "wdmg/yii2-guard": "^1.2",
        "wdmg/yii2-robots": "^1.0",
        "wdmg/yii2-stats": "^1.2",
        "spatie/pdf-to-image": "^2.1",
        "sergeymakinen/yii2-log-message": "^2.0"

    },
    "require-dev": {
        "yiisoft/yii2-debug": "*",
        "yiisoft/yii2-gii": "^2.2",
        "yiisoft/yii2-faker": "*",
        "codeception/base": "^2.2.3",
        "codeception/verify": "~0.3.1",
        "codeception/specify": "~0.4.3",
        "sergeymakinen/yii2-tests": "^2.0"
    },
    "config": {
        "process-timeout": 1800,
        "fxp-asset": {
            "enabled": false
        }
    },
    "repositories": [
        {
            "type": "composer",
            "url": "https://asset-packagist.org"
        },
        {
            "type": "git",
            "url": "https://github.com/neodev3/yii2WebsiteViewer"
        }
    ]
}
walkor commented 3 years ago

Why I can't see workerman in your composer.json. Are you sure it's the right composer.json?

eduwebconsulting commented 3 years ago

Why I can't see workerman in your composer.json. Are you sure it's the right composer.json?

<?php
require 'common.php';

$config = require (DB_CONFIG_PATH . '/console.php');

require (VENDOR_PATH . 'autoload.php');
require (VENDOR_PATH . 'yiisoft/yii2/Yii.php');

$application = (new yii\console\Application ( $config ))->init();

class MyWorker extends Workerman\Worker
{
    /**
     * Version.
     *
     * @var string
     */
    const VERSION = '3.5.6';

    /**
     * Status starting.
     *
     * @var int
     */
    const STATUS_STARTING = 1;
}

$socket = new \app\base\socketIO\Service();
//Worker::$logFile = '/var/www/html/workerman.log';
MyWorker::runAll();
It's present in the vendor but not in composer :- 

<?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://www.workerman.net/
 * @license   http://www.opensource.org/licenses/mit-license.php MIT License
 */
namespace Workerman;
require_once __DIR__ . '/Lib/Constants.php';
walkor commented 3 years ago

Please remove dir vendor/react.

eduwebconsulting commented 3 years ago

Please remove dir vendor/react.

It does not work this way as there must be an extension that requires this event-loop. Is there any other workaround?

walkor commented 3 years ago

there must be an extension that requires this event-loop.

Which one requires react/event-loop?

eduwebconsulting commented 3 years ago

there must be an extension that requires this event-loop.

Which one requires react/event-loop?

I just removed my composer.lock and then reinstall composer with same above one and it created react/eventloop folder

walkor commented 3 years ago

Add Worker::$eventLoopClass = 'Workerman\Events\Select'; to your codes like this;

$socket = new \app\base\socketIO\Service();

// == here ==
Worker::$eventLoopClass = 'Workerman\Events\Select';

//Worker::$logFile = '/var/www/html/workerman.log';
MyWorker::runAll();
eduwebconsulting commented 3 years ago

Add Worker::$eventLoopClass = 'Workerman\Events\Select'; to your codes like this;

$socket = new \app\base\socketIO\Service();

// == here ==
Worker::$eventLoopClass = 'Workerman\Events\Select';

//Worker::$logFile = '/var/www/html/workerman.log';
MyWorker::runAll();

That's awesome. Thanks a lot, it worked. You saved our day