DEV Community

Discussion on: Why does PHP get so much hate?

Collapse
 
shayneoneill profile image
shayneoneill • Edited

The "needs a third party server" isn't a negative. If theres one bitter lesson to be derived from the rise and fall of Nodejs as a backend webserver, its that servers written in scripting languages will never compete with those written in performant languages like C, Rust or Go. Theres a damn good reason why the rails or django people usually put their stuff behind something like Nginx or Apache. Like yeah, most of these things have native webservers if you want them. But you shouldn't, and nobody with any experience does.

I'm not defending PHP as a language, its atrocious, but it'll flatten any of the JS frameworks for scaleability and performance simply by virtue of the fact it doesn't even try to be a web server.

Collapse
 
andreidascalu profile image
Andrei Dascalu

there's a big different between nodejs's implementation and php. Namely that in a cloud native environment, you can let the ingress controller (effectively nginx or similar) to perform the same task. It will perform the same as on a local machine with an nginx in front of it, since it never needs more than your regular reverse proxy.
FPM doesn't work with that. It needs its own dedicated nginx/apache and doesn't work with pure reverse proxies or load balancer (which are not themselves aware of physically present files).
In this context, while PHP/FPM/Nginx can theoretically scale better on a bare metal environment, it doesn't do as well in a cloud-native environment.