duanposhi3641 2014-01-28 14:42
浏览 38
已采纳

PHP与运行除Apache之外的Node.js(Socket.io)进行通信

Is it possible that PHP to communicate with Node.js server in order to mimic real-time web apps developed completely in PHP+Apache+MySQL?

My thinking is this:

Two users, John and Adam, are viewing the same page where you can write comments.

  1. John writes a comment and hits submit.
  2. The comment is POSTed to PHP
  3. PHP saves the message in a database and Memcached
  4. PHP communicates with Node.js to update the comments page
  5. Node.js opens a socket (or other transport method with Socket.io) and updates the comments page in the browser.
  6. Adam sees a new comment added on the page in 'real-time'

I want to do this because it's much easier for me to work with PHP instead of handling all server-side stuff with node.js. And I don't want to change my whole world of PHP app to Node.js. Any good code example? or article?

  • 写回答

1条回答 默认 最新

  • dongyin2885 2014-01-28 14:59
    关注

    I would recommend dnode-php to accomplish this. Dnode is an asynchronous rpc system for node.js that lets you call remote functions and dnode-php is the php implementation.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误
  • ¥199 rust编程架构设计的方案 有偿