Why not PHP on a shared or dedicated hosted server?
Four ways to build web apps
21–30 of 181 posts
Re: Four ways to build web apps
#22Why not PHP on a shared or dedicated hosted server?
Wordpress for blogs or websites on a shared host with automatic updates and a few select plugins? Yes. Laravel or Symphony for applications? Ok.
But just PHP has way too many footguns and doesn't provide nearly enough affordances to make them worth it IMO. Plus it's a language that breaks backwards compatibility way too often, stops support for older versions. You need some sort of protection layer that shields you from all of this. So you might end up with something that is way more complex and slow than it needs to be.
Re: Four ways to build web apps
#23Earlier quoted context omitted.
> I mean honestly “HUGO static sites”…how about a directory of html files hosted by nginx or Apache? Whether you put HTML files on the mentioned services or have a build step with a static site generator is not the point. Where does your nginx server run, how do you keep it up and running, how you do provision it, how do your files end up on the server? You can write a bunch of shell scripts and do all of this on a c…
Free, for now. Once the higher interest rate environment becomes more normalized, I would not be surprised to see many services become paid.
Re: Four ways to build web apps
#24So sad. So the choice is closed source platform lock-in, a single Linux server with SQLite as database, or kubernetes? -an old man yelling at the cloud.
It is trendy nowadays to just use SQLite for a single server claiming speed advantages, but there are disadvantages as well. In my last startup, our SQL server was not directly connected to the Internet, isolating it from potential hackers.
Re: Four ways to build web apps
#25Blog posts like this always strike me as…weird. This seems like “how to build a web app for a very tiny subset of people who don’t want to learn about deploying web apps”. Maybe I’m in a bubble? It seems like 99% of the people I know actually running profitable companies have an infrastructure that roughly matches to “some Linux server somewhere”, and then upward from there it all just moves to AWS/azure, but it’s st…
1. Stateless static site. There is a variety of ways to build it (such as React or Svelte or purely by hand) and a variety of ways to host it (such as a directory of HTML files hosted by nginx).
2. Function services like Cloudflare workers, AWS Lambda, Google Cloud Functions, Azure Functions, etc. This is a way to store state without having to manage servers.
3. Single conventional Linux server.
4. Distributed containers.
All web developers should familiarize themselves with these 4 basic approaches and prefer them in approximately the order given. It's good to avoid jumping to distributed containers if you can get away with functions, a single Linux server, or even static HTML. It's also important to move down the list as the app grows rather than reinvent K8s.
Re: Four ways to build web apps
#26I could do this, or I could just throw good old React or a derivative framework at whatever UI I have to build and be done with it.
Re: Four ways to build web apps
#27Why not PHP on a shared or dedicated hosted server?
I wouldn't recommend PHP to anyone who isn't already invested/emerged in the language. Wordpress for blogs or websites on a shared host with automatic updates and a few select plugins? Yes. Laravel or Symphony for applications? Ok. But just PHP has way too many footguns and doesn't provide nearly enough affordances to make them worth it IMO. Plus it's a language that breaks backwards compatibility way too often, stop…
Do you have examples of such compatibility breakages?
I noticed Nextcloud and WordPress both seem to lag behind the last version of PHP a bit. But on the other hand I also see such thing in the Java World where people are stuck on Java 8 or 11, when backward compatibility is one of the strength of the language.
I also have PHP scripts I wrote for PHP 5.1 and still work unchanged on PHP 8.2, 12 years later. Well, I had to fix some warnings for completely dumb things I did like putting mandatory arguments after optional arguments and I'm not sure why it was working, but the upgrades have been painless for me.
Plus, I find the latest PHP version quite pleasant, with the type annotation and other new features of the language, and the execution model where your app doesn't run all the time, its php files are just called by the web server (though php-fpm). No Tomcat or uWSI or unicorn and virtualenvs to manage.
But I guess I'm a person who is "already invested/emerged in the language" :-)
(I'm also invested in Python, Java and Node.js though)
Re: Four ways to build web apps
#28Blog posts like this always strike me as…weird. This seems like “how to build a web app for a very tiny subset of people who don’t want to learn about deploying web apps”. Maybe I’m in a bubble? It seems like 99% of the people I know actually running profitable companies have an infrastructure that roughly matches to “some Linux server somewhere”, and then upward from there it all just moves to AWS/azure, but it’s st…
Scale up from there as required.
Re: Four ways to build web apps
#29I could do this, or I could just throw good old React or a derivative framework at whatever UI I have to build and be done with it.
That's how I feel when I write a bunch of HTML and CSS files and send this to prod.
Less so with an app written with a JS framework of which I now need to maintain the dependencies.