-
Notifications
You must be signed in to change notification settings - Fork 742
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
PHP 7.0 Support #357
Comments
Glad to hear everything works and with a performance gain to boot! The PECL libevent extension hasn't had a release in two years so I'm not sure what to expect with PHP7. The event extension (uses the libevent lib as well) has an open issue to get it working with PHP7. I'd say keep an eye on that ticket and give it a shot when there's an update. I'm going to close this issue as I/O is not something that's handled by Ratchet. Feel free to open this issue in reactphp/event-loop though. |
Gotcha, yea that's kinda what I figured. Thanks for the info =] |
@cboden I got this working, here is how. I used this libevent: https://github.com/expressif/pecl-event-libevent Installed using the following instructions: $ phpize7.0 (not just phpize, this threw me off) Then made sure the created libevent.so file was placed in the correct php extension directory and confirmed that This also requires the current version of ratchet-php (actually React I think) otherwise you will get an error at line 301 of the file LibEventLoop.php. The change was I hope this helps someone. |
@titansoftime Would you mind to elaborate a bit? I'm having the exact same issue. Is Ratchet dead? it seems like alot of it's dependencies only have a beta branch. (And most have not had a release in quite some time...) libevent is only a beta branch, hasn't been released in forever, and isn't compatible with PHP7. I had one HELL of a time getting ZMQ up and working (which, by the way, is ALSO only in beta) |
No Ratchet is not dead. Make sure you are using the latest version. http://socketo.me/docs/install I am running it with PHP7 and it works super great. The downside is that libevent does not work under 7.0. I posted above how to kinda get it to work but it crashes. So no libevent for php7 (yet at least). Good news is PHP7 runs faster than PHP5.6 + libevent (for my setup anyway). |
Thanks for the quick reply. Ok, so don't use your instructions as it still crashes. I've written a small websocket server (following their chat tutorial) and I agree, it does work great. Did you find a way to access the server from another php script without zmq? I don't want to use beta software on what may very well become a production solution. |
I use the default build. Haven't had any issues whatsoever. Though my use case is somewhat simple. I run a React loop and send steady data updates to connected clients. Also I simply handle user submitted http requests. Nothing too fancy. Most complicated thing I attempted was running each connection on a seperate thread which did not work. http://stackoverflow.com/questions/25704251/using-php-pthreads-with-ratchet-websocket |
HEEEEY! That's pretty cool. it's a shame it didn't work out for you. I'm baffled at just how simple the "chat" server implementation is. is that REALLY that easy to build a websocket server? As in, could I expand on the "chat" class and build a game server for something like checkers? (I'm trying to think of how I would seperate each game on the server side, just by expanding on the "chat" class and encoding my messages as JSON) |
I have mine running a browser based mmo so yes absolutely. See it in action titansoftime.com On Oct 5, 2016 4:40 PM, "TyMeador73" notifications@github.com wrote: HEEEEY! That's pretty cool. it's a shame it didn't work out for you. I'm — |
HOLY SH8T ON A SHINGLE NICE WORK MAN!!!!!! Your server is running on Ratchet? I'm registering this, I've MUST try this out! it looks amazing! |
Wait a second, where are you using the websockets? I only see AJAX requests being made? |
Once you are logged in. Title page and character select do not benefit from On Oct 5, 2016 4:55 PM, "TyMeador73" notifications@github.com wrote:
|
I just tried out the current build of php 7.0 with ratchet. Works great! Super happy about that.
One thing (and I know this isn't a ratchet issue exactly, but after hours of googling and tinkering I'm left without answers):
Is it possible to install the libevent extension with php7 or am I just going to have to wait till November for the official release (or probably later)? I've tried and tried and failed.
EDIT: I will say though, even without libevent, php7 is anywhere from about 25% to 50% faster than 5.6 in my app =]
The text was updated successfully, but these errors were encountered: