zlacker

[parent] [thread] 4 comments
1. zmxz+(OP)[view] [source] 2022-12-08 15:41:55
You're not making any sense with this sentence or explanation, why even comment if you're unaware of the execution model?

What "external" process are you talking about?

replies(1): >>Thaxll+Mc
2. Thaxll+Mc[view] [source] 2022-12-08 16:32:57
>>zmxz+(OP)
Why do you need mod_php, php-fpm, zend etc ... to create a PHP "server"?

This model is imo outdated, why can't we create a PHP server that just runs without the need of something external.

replies(1): >>zmxz+Bl
◧◩
3. zmxz+Bl[view] [source] [discussion] 2022-12-08 17:13:39
>>Thaxll+Mc
mod_php: to embed PHP binary into Apache process. It's related to Apache, not PHP.

PHP-FPM is the server you're talking about. It's a supervisor process that forks into N child processes, each handling incoming request. Supervisor deals with child exits and respawns, keeping the whole thing alive and robust.

This model is what PM2 does for node.js to keep it alive when it crashes.

There's also PHP command line interface that lets you run a server by starting a PHP script, in which you get to access OS's event loop and various other lower level interfaces.

You don't seem to be knowledgeable about the topic and you're assuming something entirely wrong. Why didn't you google before this discussion?

One can start a synchronous, process-based server or event-loop async one. What exactly is outdated here and how does ANY other language do it differently?

replies(1): >>Thaxll+9M
◧◩◪
4. Thaxll+9M[view] [source] [discussion] 2022-12-08 19:24:28
>>zmxz+Bl
I went and it came out even more confusing, with things like SAPI. It seems that there are many different way of running a simple REST API server in PHP. Where is the code running, what's compiling it / caching it etc ...
replies(1): >>zmxz+D11
◧◩◪◨
5. zmxz+D11[view] [source] [discussion] 2022-12-08 20:35:31
>>Thaxll+9M
The dialogue makes no sense if you're convinced in one thing and refuse to participate in understanding that your assumption is wrong.

All servers, of any kind, work the same way. Whether you want to accept it or not is not up to me, but fact remains.

PHP does not work in any different way, but it seems there's this huge barrier where you want to believe you're right. I can't dispel that so I bid you farewell.

[go to top]