zlacker

[parent] [thread] 20 comments
1. veganc+(OP)[view] [source] 2022-12-08 12:52:16
I haven't used PHP in almost a decade, but I've been super impressed with what I've seen in the most recent few versions. Looks really cool, it's gotten me tempted to dust it off again at some point
replies(3): >>XzAeRo+m1 >>Thaxll+C4 >>dncorn+u5
2. XzAeRo+m1[view] [source] 2022-12-08 13:02:51
>>veganc+(OP)
I've been working professionally with PHP for the last decade or so, and the last few years have been so good. The changes are very welcomed, and the performance improvements are amazing in general.

The codebases that you can create nowadays are light years away from what you would see 10 years ago. And the frameworks have improved alongside too.

replies(2): >>pluc+82 >>pwytho+C2
◧◩
3. pluc+82[view] [source] [discussion] 2022-12-08 13:08:18
>>XzAeRo+m1
Same. The vibe difference between a modern php app and an old php app is so tangible, it makes you constantly appreciate it.
◧◩
4. pwytho+C2[view] [source] [discussion] 2022-12-08 13:11:27
>>XzAeRo+m1
It has been a decade for me too, if not more. What's your favorite framework/tools/tips? I'd love to get back into it.
replies(1): >>conrad+C3
◧◩◪
5. conrad+C3[view] [source] [discussion] 2022-12-08 13:17:46
>>pwytho+C2
Pick one framework between Symfony and Laravel and follow the docs.

Maybe read https://stitcher.io posts about the new features since 8.0 to have a grasp of the language changes.

replies(1): >>martin+Cb
6. Thaxll+C4[view] [source] 2022-12-08 13:26:09
>>veganc+(OP)
The fact that the language is weirdly executed server side is a non starter imo. PHP is still the only language doing that no?

Edit: I'm talking about the php code being compiled / run by an external process which makes the whole thing staless.

It was a "working" design when people were dropping .php files in ftp folder on some hosting provider.

replies(4): >>zmxz+I6 >>paulry+j7 >>ape4+7a >>zmxz+nr
7. dncorn+u5[view] [source] 2022-12-08 13:32:24
>>veganc+(OP)
Do yourself an extra favour and start with Symfony or Laravel. These frameworks are a joy to work with.
replies(1): >>sam_go+4m3
◧◩
8. zmxz+I6[view] [source] [discussion] 2022-12-08 13:39:30
>>Thaxll+C4
What does "weirdly executed" mean? I can't even guess so would you be so kind to clarify?
◧◩
9. paulry+j7[view] [source] [discussion] 2022-12-08 13:42:22
>>Thaxll+C4
What is weird?

That it's stateless, and therefore often deployed with a module or FPM?

◧◩
10. ape4+7a[view] [source] [discussion] 2022-12-08 14:05:01
>>Thaxll+C4
You can run it standalone. On the command line: "php myscript.php"
◧◩◪◨
11. martin+Cb[view] [source] [discussion] 2022-12-08 14:15:31
>>conrad+C3
What would you recommend? Looking for a more robust and streamlined solution to build small(er) pages...
replies(2): >>esskay+xf >>ok_coo+yt
◧◩◪◨⬒
12. esskay+xf[view] [source] [discussion] 2022-12-08 14:39:41
>>martin+Cb
Not OP but I'd personally recommend Laravel over Symfony if you're just getting back into it. Fundimentally they are very similar, but Laravel's less of a learning curve and these days has a significantly larger community.

There's resources like laracasts which take you through from the basics to highly complex concepts without it feeling like you're being lectured.

One benefit of Laravel is that under the hood it shares a lot of Symfonys core components so should you decide to switch at some point it's not too much of a learning curve.

replies(1): >>martin+1F3
◧◩
13. zmxz+nr[view] [source] [discussion] 2022-12-08 15:41:55
>>Thaxll+C4
You're not making any sense with this sentence or explanation, why even comment if you're unaware of the execution model?

What "external" process are you talking about?

replies(1): >>Thaxll+9E
◧◩◪◨⬒
14. ok_coo+yt[view] [source] [discussion] 2022-12-08 15:50:39
>>martin+Cb
If it helps, Laravel feels like the Rails of the PHP community.

I've used it to build ~5 websites and it's been very solid. The docs are pretty good and it does most of what you need out of the box. Especially the 8+ versions of Laravel. If there's something you need that's not included in the framework itself, it's likely there's a well-maintained community package.

Just my 2c.

replies(1): >>martin+cF3
◧◩◪
15. Thaxll+9E[view] [source] [discussion] 2022-12-08 16:32:57
>>zmxz+nr
Why do you need mod_php, php-fpm, zend etc ... to create a PHP "server"?

This model is imo outdated, why can't we create a PHP server that just runs without the need of something external.

replies(1): >>zmxz+YM
◧◩◪◨
16. zmxz+YM[view] [source] [discussion] 2022-12-08 17:13:39
>>Thaxll+9E
mod_php: to embed PHP binary into Apache process. It's related to Apache, not PHP.

PHP-FPM is the server you're talking about. It's a supervisor process that forks into N child processes, each handling incoming request. Supervisor deals with child exits and respawns, keeping the whole thing alive and robust.

This model is what PM2 does for node.js to keep it alive when it crashes.

There's also PHP command line interface that lets you run a server by starting a PHP script, in which you get to access OS's event loop and various other lower level interfaces.

You don't seem to be knowledgeable about the topic and you're assuming something entirely wrong. Why didn't you google before this discussion?

One can start a synchronous, process-based server or event-loop async one. What exactly is outdated here and how does ANY other language do it differently?

replies(1): >>Thaxll+wd1
◧◩◪◨⬒
17. Thaxll+wd1[view] [source] [discussion] 2022-12-08 19:24:28
>>zmxz+YM
I went and it came out even more confusing, with things like SAPI. It seems that there are many different way of running a simple REST API server in PHP. Where is the code running, what's compiling it / caching it etc ...
replies(1): >>zmxz+0t1
◧◩◪◨⬒⬓
18. zmxz+0t1[view] [source] [discussion] 2022-12-08 20:35:31
>>Thaxll+wd1
The dialogue makes no sense if you're convinced in one thing and refuse to participate in understanding that your assumption is wrong.

All servers, of any kind, work the same way. Whether you want to accept it or not is not up to me, but fact remains.

PHP does not work in any different way, but it seems there's this huge barrier where you want to believe you're right. I can't dispel that so I bid you farewell.

◧◩
19. sam_go+4m3[view] [source] [discussion] 2022-12-09 11:43:11
>>dncorn+u5
We picked Laravel ~15 years ago, and regret it.

For getting up and running, it saves time. For large projects, it adds leaky abstractions, overhead for each request, a need to upgrade another layer - with poor upgrade compatibility (in our anecdotal case), and very little gain. And it has it's own learning curve, which with modern PHP may be redundant.

Symfony looks better in that it is more of a library and less of a framework, though of course that has its own tradeoffs.

IMO, the weakest part of PHP is the db functions (both PDO and mysqli/postgres)

◧◩◪◨⬒⬓
20. martin+1F3[view] [source] [discussion] 2022-12-09 14:16:48
>>esskay+xf
Thanks, I guess I'll look into Laravel then.
◧◩◪◨⬒⬓
21. martin+cF3[view] [source] [discussion] 2022-12-09 14:17:23
>>ok_coo+yt
Thank you, that helped me. Had a quick glance at the documentation and it seemed solid indeed.
[go to top]