Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libevent] is currently not work in php7 #40

Closed
kocoten1992 opened this issue Dec 24, 2015 · 5 comments
Closed

[libevent] is currently not work in php7 #40

kocoten1992 opened this issue Dec 24, 2015 · 5 comments

Comments

@kocoten1992
Copy link

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

@majuca
Copy link

majuca commented Jan 14, 2016

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 ;-)

@kocoten1992
Copy link
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

@titansoftime
Copy link

titansoftime commented Jul 4, 2016

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

@titansoftime
Copy link

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

@clue
Copy link
Member

clue commented Jan 9, 2017

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants