Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Nobody runs PHP in CGI mode, either they go with libapache2_mod_php, where Apache itself does the work or PHP-FPM with Nginx.

Either way you are not going to pay for the PHP process startup cost.

PHP can also cache the interpretations of files so you avoid that cost as well.

And frameworks usually have their own usually file-based caching mechanism.

At the end of the day it's still going to have some costs compared to a single application server model, but for most web apps it's not going to matter, however it greatly simplifies the programming model.



Sure, it’s not pure CGI, just CGI on steroids. But frankly, it hasn’t gone too far. I’ve seen a lot of WordPress plugins with spaghetti code being called on every invoked endpoint. File caching is evil—many PHP devs love using the filesystem to store things, which is pretty nasty under K8s.

But it’s not the language itself, as I was advised. True asynchronous handlers are possible, which is promising.


> Sure, it’s not pure CGI, just CGI on steroids. But frankly, it hasn’t gone too far.

It doesn't need to go far, because it's selling point is that it's easy to learn and use.

The way I see PHP is not as a competitor to Java, .Net, NodeJS or Rust, instead I see it as a platform for non-advanced developers to be able to be able to create things and actually have the whole thing be cheap and sustainable.

> But it’s not the language itself, as I was advised. True asynchronous handlers are possible, which is promising.

The whole point of PHP is that it's single threaded, blocking and from the developer's point of view: your program starts at the request and terminates when the HTTP request is complete, this is what makes it simple to comprehend, if you want async, I would tell you to use something like Node instead.

> File caching is evil—many PHP devs love using the filesystem to store things, which is pretty nasty under K8s.

It's usually just an annoyance or just something you need to configure or just brute force it with a shared mount.

> I’ve seen a lot of WordPress plugins with spaghetti code being called on every invoked endpoint.

That's not really the problem of the language itself, the language doesn't force you to run anything on every request.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: