Skip to content

[libevent] is currently not work in php7 #40

Description

@kocoten1992

It all start with:

/vendor/react/event-loop/LibEventLoop.php on line 34

After trying to make it work, it come to:

pecl/libevent requires PHP (version >= 5.3.0, version <= 6.0.0, excluded versions: 6.0.0), installed version is 7.0.1-2+deb.sury.org~wily+1

No valid packages found

Not sure if I report this here is right since it depend on libevent

Activity

  1. majuca commented on Jan 14, 2016

    @majuca

    Hi,

    I can run with php 7 by compiling the libevent : https://github.com/expressif/pecl-event-libevent

    But when I run my websocket, I have an error on the line 301 of the file LibEventLoop.php:

    $this->timerCallback = function ($_, $_, $timer) {
    

    tell me that $_ is redefined. I just changed by:

    $this->timerCallback = function ($_, $_1, $timer) {
    

    and it works but I'am sure that my modification is not correct ;-)

  2. kocoten1992 commented on Jan 14, 2016

    @kocoten1992
    Author

    didn't go that far :P, still scare the idea of self doing everything (self compile), I heard socket io do better than php in term of socket, will give it a try

  3. titansoftime commented on Jul 4, 2016

    @titansoftime

    I use ratchet-php which utilizes the React EvenLoop. Upgrading to the new package solved this for me.

    I checked the source and the official solution is $this->timerCallback = function ($_, $__, $timer) {...

    Full Details:

    ratchetphp/Ratchet#357

  4. titansoftime commented on Sep 23, 2016

    @titansoftime

    Although it "works" I had to eventually disable this as it would occasionally segfault.

  5. clue commented on Jan 9, 2017

    @clue
    Member

    The duplicate parameter names have been fixed via #45, so this should theoretically work once libevent supports PHP7.

    There's ongoing effort to update libevent to support PHP7 in php/pecl-event-libevent#2. However, the current version occasionally segfaults. This could not be observed in earlier version, so it is believed that this is a bug in libevent, rather than React.

    As such, there's little we can do here.

    In the meantime, you may want to check out the "event" extension. We've seen reports of people successfully using this on PHP7.

    I believe this has been answered, so I'm closing this for now. Please come back with more details if this problem persists and we can reopen this 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions