S
S
sampekmoy2020-07-11 22:37:04
PHP
sampekmoy, 2020-07-11 22:37:04

How does php and node.js run?

I noticed when creating a chat on different stacks that the php script is launched every time it is accessed, at the same time, node.js is launched once and does not turn off when accessed, that is, in a php script, you cannot store an online chat server in memory, in node .js is possible. Is creating a new execution instance on the server called CGI (php script for example)? What is the name of the node.js principle (run once and refer to it infinite times) then?
What then server-side languages ​​execute the principle of launch like php and node.js?
And is it possible to run a php script once, like node.js and access it, so that the script spins on the server and does not turn off?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DevMan, 2020-07-12
@sampekmoy

php script is run every time it is accessed
this is the classic mode of using puff.
and it is this mode that provides its main advantage: if something goes wrong, only this particular script will fall, and not all at once.
but you can quite easily raise your own server on the puff, just like a node does. and there are many ready-made developments that will help with this.
of the minuses - it requires a different level of skills.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question