Hacker News new | past | comments | ask | show | jobs | submit login

The big guys, who know what they're doing use PHP because it makes devops stupid simple. Throw it on the server, its ready. That's always been PHP's killer feature.



Is it? Last time I used PHP (around 5.x-7.x) it was exactly the other way around. For production you needed php-fpm, nginx, opcode cache... it was a nightmare compared with go or even java. Is it better now?


Does anyone really deploy PHP directly on servers still..? Running it in a Docker container is the simplest thing possible, runs anywhere, and has top-notch performance.


I meant Docker. The fact that I needed multiple processes (nginx+fpm) made PHP setup tricky compared with e.g. Java with embedded server.


I know what you mean; that has been a problem in the past. In case you have to again, I'd recommend looking into either Roadrunner or Swoole. That makes it possible to have your application run more or less standalone in a single container, hosted by a native application server. This boosts performance incredibly, and exposes a single HTTP port, as it should be.

For Symfony: https://github.com/k911/swoole-bundle

For Laravel: https://laravel.com/docs/8.x/octane


aha, that looks good. Thanks


> The fact that I needed multiple processes (nginx+fpm)

I believe you can have fpm listen on TCP and run nginx in another container if you want, although I haven't tried it so I can't vouch for it.


Yup, tried that. It’s a bit too complex imho but works too.


The opcode cache is built in now. A webserver and php-fpm are still a good idea.


I think the thing is, you install those once, and then you can run an infinite number of websites.

They also share the same resources, so even your little blog can take as much (or more) traffic than your production application.




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

Search: