Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can node.js be integrated with php?

Tags:

php

node.js

mysql

is that even a good idea for scaling heavy php apps ? for example, how does node's mysql module compare to php's mysqli extension in terms of performance etc ..

like image 477
BaTr Avatar asked Oct 25 '22 07:10

BaTr


1 Answers

I'd seriously consider wrapping your PHP app with node.js; that is, having a migration path of your existing PHP being called by your node code, eventually migrating the PHP code into Javascript. The reason being, the execution model of node.js (non-blocking) doesn't really play well with PHP's execution model. That said, the execution models can be made more compatible with a wrapping approach; that is, having node be your exposed server, and making appropriate PHP calls (re-request); you can likely use that process to "migrate" your "wrapped" PHP over to a node server, then slowly migrate your PHP code to node.

Of course, this begs the question of whether or not you really even need / want to do this, but that's for you to determine...

like image 170
Paul Sonier Avatar answered Oct 27 '22 09:10

Paul Sonier