zlacker

[parent] [thread] 5 comments
1. jjice+(OP)[view] [source] 2022-12-08 14:17:20
I write PHP every day and I don't mind the language at all. It's not exciting per-say, but it's a good tool for the job. My real complaint is about how it's served via Apache and my real problem there is that Apache just depends on a lot of things being in the right place and it can suck for updates since it's harder to keep all things config in your repo. Docker is probably a fix for that, but there's an internal political battle there that I'd rather not touch.

I know this is contradictory to what some people love about PHP, but having a directory where everything is isolated and I just run npm start or my go binary or whatever is much easier to reason about for me, rather than also have to think about Apache's end.

replies(5): >>abujaz+K4 >>conrad+K5 >>timdev+eF >>gosuki+AZ >>larsny+hSb
2. abujaz+K4[view] [source] 2022-12-08 14:47:01
>>jjice+(OP)
Apache doesn’t need to be in the loop. You can run php-fpm directly behind a load balancer that supports fastcgi, like haproxy. And for depvelopment you can simply use the built in server.
3. conrad+K5[view] [source] 2022-12-08 14:52:02
>>jjice+(OP)
Why not nginx with php-fpm?

That won't really solve having config files at different places though.

4. timdev+eF[view] [source] 2022-12-08 17:33:18
>>jjice+(OP)
Caddy works quite nicely in front of php-fpm, as a replacement for apache.
5. gosuki+AZ[view] [source] 2022-12-08 19:15:00
>>jjice+(OP)
Most serious web apps will end up behind a reverse proxy with nginx or apache though
6. larsny+hSb[view] [source] 2022-12-12 11:57:51
>>jjice+(OP)
I also write PHP every day, and the solution I've landed in is, as you suggest, Docker. With Docker and docker-compose you can put Apache config, MySQL data, etc, in your working directory which makes moving/backing up your project a lot easier.

There is however a significant overhead to Docker. Building images takes time (and you will need to build your own, if you rely on any kind of PHP extension such as mbstring, etc) and just wrapping your head around everything is harder than people make it out to be.

That being said, I used to have my own set of bash scripts to setup local virtual hosts, databases, etc, and various strategies to keep configuration contained to single projects, but things always leaked out of the boxes I tried to put it in and in the end all those strategies failed.

So, my current estimate is that Docker doesn't save me much time, but it elevates the quality of the projects I'm working on. So overall I find it worth it to put in the effort to use Docker.

[go to top]