News for hackers. Stuff that matters.
Re:A bank runs serverless with PHP and AWS Lambda by stronglikedan on Wednesday November 01, 2023 @11:31AM (#38099638)
Perhaps we're finally at a point on HN where people realize there's no need to question the use of PHP. it's a robust, capable language that's just as, or more, suitable for the majority of use cases as any other language.
Re:A bank runs serverless with PHP and AWS Lambda by zelon88 on Wednesday November 01, 2023 @11:55AM (#38100057)
I think most of that was coming from the (then) next generation JS crowd who was trying to fit everything into one neat little box. They've since burnt themselves out and found the limitations in their approach during the process.
Re:A bank runs serverless with PHP and AWS Lambda by Muromec on Wednesday November 01, 2023 @03:41PM (#38103800)
I’m the usual suspect for shi^W questioning php and I think you are wrong about demographics.
Re:A bank runs serverless with PHP and AWS Lambda by solardev on Wednesday November 01, 2023 @12:55PM (#38101142)
Just a perspective:

PHP 7+ (the language) was wonderful, especially compared to Javascript's woefully inadequate standard library. It had so many helper functions that made even working with JSON and big data objects much easier.

But having to manage its buildchain wasn't fun (meaning needing to containerize a web server, PHP-FPM, etc. for every trivial deployment). Then needing to support an OS behind it with updates and such, even Dockerized.

For serverless in particular, the availability of V8 isolates (like in CF Workers) or other "just run this snippet of code and don't bother me about the infra" services (like Lambda) or "I can host my serverless in a file alongside my other frontend stuff" (like on Vercel/Netlify) means that JS functions are pretty much zero-config 1-click deploys.

Is there anything like that in the PHP world? For Bref, for example, you have to set up a lot of stuff before the serverless will run: https://bref.sh/docs/setup

For Google Cloud Run (which supports auto-scaling containerized PHP, not true serverless but closer to it than a full VM), you have to manage docker: https://cloud.google.com/run/docs/quickstarts/build-and-depl...

Maybe the closest one I know of is a Google Cloud Function (https://cloud.google.com/functions/docs/create-deploy-http-p...) which comes close to the "function as a service" of JS serverless, but you still at a minimum have to deal with a tiny folder structure (index.php + composer.json).

Is there anything similar on AWS or elsewhere?

Re:A bank runs serverless with PHP and AWS Lambda by distantsounds on Wednesday November 01, 2023 @01:09PM (#38101364)
your container running the web server and php-fpm should only need to be deployed once. the point of PHP is that to update your code you just... replace the file. this sounds like a poorly designed CI pipeline that is of no fault of PHP.
Re:A bank runs serverless with PHP and AWS Lambda by solardev on Wednesday November 01, 2023 @01:55PM (#38102145)
What? There was no CI involved. It's more a matter of being able to spin up separate environments for different teams, projects, or especially clients. Both for security and billing and resource allocation etc.
Re:A bank runs serverless with PHP and AWS Lambda by gumballindie on Wednesday November 01, 2023 @03:31PM (#38103626)
I think it’s more about people ignoring PHP. I worked with PHP for a long time and was extremely happy to move away from it. PHP developers usually lack understanding of engineering practices and make things up that sound like engineering. Generally speaking I now advice everyone to avoid that language. Use python or nodejs if you want something cool for the web. PHP is dead.