3 ms·
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 c
by snov 5y ago
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?
- Aeolun 5y agoI 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.
- 9dev 5y agoDoes 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.
- snov 5y agoI meant Docker. The fact that I needed multiple processes (nginx+fpm) made PHP setup tricky compared with e.g. Java with embedded server.
- 9dev 5y agoI 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 https://github.com/k911/swoole-bundle For Laravel: https://laravel.com/docs/8.x/octane https://laravel.com/docs/8.x/octane
- snov 5y agoaha, that looks good. Thanks
- jbboehr 5y ago> 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.
- snov 5y agoYup, tried that. It’s a bit too complex imho but works too.
- tyingq 5y agoThe opcode cache is built in now. A webserver and php-fpm are still a good idea.