News for hackers. Stuff that matters.
Re:PHP is worth learning and using by boudin on Thursday November 18, 2021 @07:22AM (#29264613)
I see this as the opposite and find it adds quite a load of complexity and prevent to do some form of optimization in an app that has its own server.

It adds its load of complexity on how to run the apps itself, you need an external server, apps often requiring some customization of the server that will run it (either mod-php or php-fpm). It means that parts of our app settings lives outside of the app, it also make updating php itself quite annoying.

Re:PHP is worth learning and using by tlackemann on Thursday November 18, 2021 @08:24AM (#29265078)
I don't find this to be true at all.

> you need an external server

Spoiler, you need an external server for everything on the web; you've just been brainwashed to think serverless is actually that.

Re:PHP is worth learning and using by boudin on Thursday November 18, 2021 @12:26PM (#29267996)
What are you talking about?

Lots of languages and frameworks make it easy to be self-hosted with there own server. In Python, .net, Go, Rust this is quite common.

This means that your app can be a self-contained app + server and the server part can have some business logic as well.

With Go, .net, Rust apps (and potentially others) that's quite nice to be able to produce a single binary app that you can just run anywhere without installing any framework or setting up any external server and it's ready to listen to incoming queries.

That can even be a good enough setup for home things that are not exposed to the web and where setting up reverse proxies could be overkill.

Re:PHP is worth learning and using by __MatrixMan__ on Thursday November 18, 2021 @09:33AM (#29265824)
Good point, but just to nitpick: I think that ipfs-js let's your external server be a process in someone else's browser, which is about as unserverlike as servers get.
Re:PHP is worth learning and using by thecatspaw on Thursday November 18, 2021 @08:27AM (#29265102)
You do not need an _external_ server for a lot of languages. If you use node for example you can use the express package to run a custom server, or embedded tomcat for java
Re:PHP is worth learning and using by tlackemann on Thursday November 18, 2021 @08:30AM (#29265135)
I suppose, but I've never encountered a production site that was using Gunicorn or similar as a true server. Usually that's coupled with something like Nginx or HAProxy.

So yeah, you technically don't need one for Ruby or Node.js, but I sure would.

Re:PHP is worth learning and using by redm on Thursday November 18, 2021 @08:51AM (#29265307)
PHP has a built in web server you can launch from the CLI and run the script. `php -S <address:port>`
Re:PHP is worth learning and using by fooyc on Thursday November 18, 2021 @09:49AM (#29266005)
The kind of optimizations you would do in an application server would prevent you from scaling pass a single server
Re:PHP is worth learning and using by timw4mail on Thursday November 18, 2021 @09:13AM (#29265574)
PHP does have it's own built-in server as well, although it is not really meant for production use.

Global PHP configuration options have become less important over time, with resource limits and extensions being most of what has to be configured now.

Re:PHP is worth learning and using by boudin on Thursday November 18, 2021 @12:30PM (#29268047)
My bad, I didn't know that about PHP build in server

I only host one PHP app now (Nextcloud) and it has definitely been a bit of a pain in comparison with other things I self host.

Re:PHP is worth learning and using by timw4mail on Friday November 19, 2021 @10:35AM (#29278219)
Nextcloud is more complex than most PHP apps.