Zenth
Zenth

Reputation: 811

Interact NodeJS and PHP without "intermediate" (like redis)

i need ideas to solve this:

I have a entire website in PHP (5.2) in a PHP "shared server", only i can use apache+PHP, CGI & NodeJS, no memcached, redis or another software.

And i need to comunicate the PHP and the NodeJS Script.

My first approach is using socket connection, creating in NodeJS a socket listener and connect to it witch PHP, and then, send commands, whait for response, and close connection (and end PHP Script). To the other side, i can call PHP script via ¿httprequest? ¿or using sockets again?

The problem of using sockets fron Node to PHP, i CANT leave PHP script runing with set_time_limit(0) because the fuc... server, need to "call" PHP for another way.

The NodeJS and Apache + PHP are in the same machine, i need to make the code for the fast response time (sockets better than web-calls).

Better ideas or other solutions?

thanks!

Upvotes: 1

Views: 167

Answers (1)

Rahul_Dabhi
Rahul_Dabhi

Reputation: 730

Try memcached it's easy and very fast.

Upvotes: 1

Related Questions