Using comet with PHP?

后端 未结 11 1392
星月不相逢
星月不相逢 2020-11-22 03:09

I was thinking of implementing real time chat using a PHP backend, but I ran across this comment on a site discussing comet:

My understanding is that

相关标签:
11条回答
  • 2020-11-22 04:03

    I'm having a similar issue. One option I'm finding interesting is to use an existing Comet server, like cometd-java or cometd-python, as the core message hub. Your PHP code is then just a client to the Comet server -- it can post or read messages from channels, just like other clients.

    There's an interesting code snippet linked here: http://morglog.org/?p=22=1 that implements part of this method (although there are bits of debug code spread around, too).

    0 讨论(0)
  • 2020-11-22 04:03

    I'm current implementing a scalable PHP Comet server using socket functions. It is called 'phet' ( [ph]p com[et] )

    Project page: http://github.com/Tim-Smart/phet

    Free free to join in on development. I have currently managed to get most of the server logic done, just need to finish off the client side stuff.

    EDIT: Recently added 'Multi-threading' capabilities using the pcntl_fork method :)

    0 讨论(0)
  • 2020-11-22 04:04

    You will have to create your own server in PHP. Using Apache/mod_php or even fastcgi will not scale at all. A few years old, but can get you started:

    PHP-Comet-Server: http://sourceforge.net/projects/comet/

    0 讨论(0)
  • 2020-11-22 04:13

    mod_php is not the only way to use PHP. You can use fastcgi. PHP must be compiled with --enable-fastcgi.

    PHP as FastCGI: http://www.fastcgi.com/drupal/node/5?q=node/10

    0 讨论(0)
  • 2020-11-22 04:13

    A new module just came out for the nginx web server that'll allow Comet with any language, including PHP.

    http://www.igvita.com/2009/10/21/nginx-comet-low-latency-server-push/

    0 讨论(0)
提交回复
热议问题