134 points · by xd · 5y ago · 169 comments
You drop a file in your public web server folder and you’re done. Prior was CGI Perl scripts that hacked together how to access session and rest data. Or you had to develop in C. PHP had native support for the web. It also eliminate the need for an app server.
I’m still not certain even today, if anything exists that is faster to get a dynamic site up and running than PHP.
Great for prototyping, or just to encourage new programmers (as they can see results almost immediately).
Though PHP was essentially thrown together initially so had a massively inconsistent standard library, had some insanely unsafe defaults for a few major versions, and other issues that it is very valid to complain about. It was also closely associated with mysql which at the time played very fast and loose with data integrity (2008-02-31? - perfectly valid date to store! Foreign keys? Let the business layer worry about rules like that! Transactional integrity? Again, sort that elsewhere!) in the name of ease & claims of performance - the two shared bits of each others reputation.
I also just trashed an extremely repugnant PDF template processor, first with fpdf.org, then with tcpdf.org - far from perfect, but improvement a thousand fold.
Exaggerate, you say? Can I interest you in COBOL on my VAX (I'm not kidding)? Or perhaps (is this is too new-fangled) assembler under EXEC-8 on OS2200?
I do like the PHP solutions very much, and yes, I work in a museum.
Edit : large part cut for brevity
I really should have composed what I just said, much better than I have done -/so I have cut the bulk from my first too enthusiastic version / I mean to describe how much you can get running with just BASIC language skills and, at least atop of VMS, and buying the right licenses, that answer is "anything almost anything that you can imagine from a power station to a stock exchange ". Stack Overflow and POF running tiny amounts of hardware under Windows Server aren't rare cases of the potential for leveraging commercial tools. If VMS is more palatable than Windows (and certainly I will not compare the two for TCO) and the Intel architecture pricing for RDB holds up I totally believe that SAAS on VMS can be a viable alternative platform capable of making a minor industry of positions for the experienced programming talent for whom ageing has become a invisible barrier to retirement or even employment and if that's possible, then there's right there the environment wherein a generation of younger engineering minds can both take respite from rat race technology change and learn from direct experience to write the reliable systems for replacing what I fear is a current batch of the most fragile infrastructure building in modern history.
edit : incidentally, I think the entry level salaries the FAANG group is paying is a coincidentally perfect match for the price for a consultant from IBM or whoever and I don't think this is a accident by any means, only it didn't seem to work out how the old big firms would have wanted things..
edit, again, mea - my conspiracy being IBM et.al killed the good development tools in hope for being able to bill for consultation only they didn't count on the ability for big tech competitors to dismantle entirely other industries to feed paying salaries at the level of consulting rates and monopolizing the talent in that way.
RAD tools were focused on Desktop application development and web suddenly took over everything.
Rails made this approach viable at the time.
Rails didn't get big until 2006, eight years later than this time period =).
Wait for the crows.
A simpler language for a simpler time.
Isn't that still the case?
At least here in Europe the word Backend Developer is basically synonymous with PHP Developer.
Every other language for backend development is pretty niche. Sure there is Java (and C#) for the enterprise but that was already there back then. Ruby had a good run but modern PHP with frameworks like Laravel could reclaim most productivity benefits so not that fierce of a competition. JS with node, sure but I mostly hear it in the context of micro services which is the opposite of wanting to get something done.
> PHP barely ages - from 1999 or 2010 or 2020, it looks similar and works fine.
Yes but no. PHP takes stability and backwards compatibility quite seriously but the language and culture around it has changed tremendously. The wild west days are long gone, it has gotten much more professional and mature while adding many modern language features.
Pretty much, I've seen PHP powering traditional companies with revenue in the hundreds of millions (approach billions).
> At least here in Europe the word Backend Developer is basically synonymous with PHP Developer.
Here in Norway backend mostly means JVM or dotNet it seems. Last I touched a PHP installation that wasn't a prototype or a blog or something was in the spring of 2009.
That said: In my opinion PHP has been massively underrated in HN circles.
Even on basic hardware, hundreds of requests per second are trivial -- assuming you aren't loading a bunch of files ("require") or making 800 trips to the database to load the site.
I've never found PHPs performance to be a limiting factor, even when I was dealing with dynamic page loads coming in at sustained rates between 50 and 100 per second, and this was on PHP4/5, slow (400MHZ), single core, low ram system. FAMP stack.
I assume Java apps are the same way -- I've never encountered (to my knowledge) a java-based website that wasn't slow. I assume anything that relies on a huge framework probably also had that framework to blame for most performance problems.
And by squeze I mean copy 30 lines or so from their hello world tutorial and run: php start.php
PHP was simple to use, and to understand its logic, because it was embeded into HTML itself if you want to. No need to write views, controllers, templates, anything. And most of the shared hosting (paid and free) supported it.
[1]Includes were like magic back then because if you had a heavy content website with a lot of inner pages (fansites), updating the navigation sidebar was a pain in the ass. Originally they were made with framesets, later iframes (with no borders, but if the content changed, a scrollbar appeared). When I (and my friends) started to use PHP and be able to use includes, it was awesome.
(Edited to fix formatting)
I sometimes find myself thinking about teenagers getting started nowadays and the accessibility of development, but I suppose there are a lot more resources now than the early 2000s for some enterprising kids to get started.
With PHP you can just start typing in your file and produce output. Even with lightweight frameworks like Flask there is boilerplate.
And if you really need php-fpm (which you should, anyway), at least in Ubuntu (never set up on other distro), the boilerplate nginx config is there.
The implications of what this meant for security were very important too, but in a negative way. Instead of an application with a single or few small entry points (like CGI), you could just design your PHP app with a bunch of files spread across the exposed public directory structure, and for a long time this was the reigning paradigm for PHP.
This, combined with the extension controlling whether it was processed as a PHP script or a plain text file meant that anyone making a quick and dirty backup of a file they were changing that didn't consider this would often end up exposing files to the public they didn't intend (mv config.php config.php.bak).
Additionally, since most people were running on shared hosting platforms and PHP was usually run as the webserver user, and many applications were designed to be dropped entirely into a public web structure, any capability for writing locally (like allowing file uploads) often consisted of setting a directory world writable to drop files in. Even ignoring how often people screwed up setting permissions and set everything of theirs world writable, even when done correct this usually ended up being security through not-so-obscurity, since common apps had default locations they used more often than not (customizing that required more user interaction and knowledge to set up, which was against the ethos of "drop in and use" PHP heavily leaned on initially).
PHP's ease of use was the ease of use of Windows 95 compared to Windows NT or Windows 2000. Sure, things are easier when you don't have to care about users and permissions and security. But you need to bootstrap any success you have into fixing those problems ASAP.
PHP was always a victim of it's own success in this regard. The thing that made it easy to use for people was that it did away with a lot of the security concerns that were (barely) in place at that time, and the effects of that are what made it a nightmare for those managing it, and often at one point or another those using it as they were bitten by these problems.
I'm glad we've all moved on from that. PHP did a lot to make it easier for people to do stuff online, and that in itself is a good thing and a laudable achievement. I'm unsure if it was a net gain though. It's too complex for me to easily say it was one, nor that it was definitively a net loss.
How often do people leak things via S3 because they couldn't set the permissions properly? Same thing as you mention, except it's yet another layer that has to be maintained.
I went from Perl to PHP, and my productivity definitely improved, and the speed of execution also improved significantly. mod_perl was available, but I was pretty well switched to PHP by the time I really looked into that.
I think the fact that it's another layer and not essential for anything is a pretty good reason why it's not necessarily the same.
What I'm talking about is the default or minimal install complexity and how that affected what was to come. I'm not sure anyone considers S3 a default or minimal config for a website or code execution on the web.
I do agree it's much easier to add complexity these days though, and there are plenty of resources that probably encourage it.
> mod_perl was available, but I was pretty well switched to PHP by the time I really looked into that.
You didn't miss much. While mod_perl was first released within a year or two of the first version of PHP, it works in a fundamentally different way, as wasn't really suitable for shared hosting, so it was never going to have the same popularity. mod_perl keeps a perl interpreter persistent per Apache thread, but it doesn't (can't) really completely separate one request from the next, and given's the prevalence of globals that Perl lets you tweak that affect how many built-ins function (and the ability to redefine portions of the symbol table), it wasn't really suitable for shared environments, just for applications which were mostly the sole purpose of the webserver.
In fact, the way it works is sort of to just take any file set to be handled by it, and eval the content of it in a sub (to deal with some scoping issues), and display the output. As you might imagine, this required special care to not accidentally create closures and pollute subsequent request handling with data in variables from prior requests.
The guy who was interviewing me was sitting their shaking his head like that wasn't a valid answer.
I wonder what would be the proper answer. Also if there is a proper answer, they shouldn't ask what your favourite feature is.
I hate it when people ask questions where they expect some sort of exact question to see if you think in the exact same manner as they do. Just ask me what you want to know or I'll pack my shit and leave.
For a PHP deployment this is all handled by a fully standardized Apache httpd (at least back in the days, nowadays setups became more fancy) and the PHP.user just uses (s)ftp to copy the files in and all works magically. Need to update? - Just copy the new files. This is the unbeaten simplicity. (Of course that breaks at some point, like imma high traffic site simply copying the files via sftp will lead to some request in the middle having inconsistent state etc.)
mod_perl worked without running an app server but I still don't know how other languages never implement mod_$lang or $lang-fpm that reloads code on change, so you don't have to place auto restart magic on development.
These days you need transpilers (but I don't blame the flourishing of higher level tools when JS, CSS kind of totally stalled from adding useful features and people never let go of old browsers), auto restart of app servers and other build procedures just to get started and that's one of the reason people stick to plain PHP/CSS/JS (loaded independently via script tag...).
We do want nice pretty slick GUI that does all that for cross platform to get new people started without asking them to do console magics. I know a few good ones but doesn't seem cross platform.
By far, the most useful tool in the box was probably MySQL. Before then, you had to work with flat files.
Oh, and "magic quotes" was a bad idea ;-)
Prior to PHP as part of a LAMP stack, I had indeed been cobbling Perl scripts and GDBM key/pair databases to do web apps for various projects and customers. The ability to just print to the browser with PHP without explicitly having to send HTTP headers was wonderful.
FLASK_ENV=development python run.py
To get hot reloading working under flask, and it’s a lot less complex than django.In some ways, that incredible ease of use of PHP for backend mirrored the ease of use of Macromedia Flash for animators and front-end/UX designers, which also led to a generation of middle schoolers and high schoolers tinkering and learning from each other and accidentally falling into a real career path.
Thank you Rasmus and PHP team... despite all the warts PHP gets often-deserved flack for, you have undoubtedly changed the lives of, quite possibly, hundreds of thousands of people who would never have become professional developers without the easy on-ramp that your creation provided.
This was before the embarrassment of riches that we have now...
- before proliferation of open source examples on GitHub,
- before StackOverflow,
- before jsfiddles,
- before snippets on gist or pastebin
- before very common web forums (many of which were eventually written in PHP in fact)...
- before fantastic search results of google...
Best you could hope for when you got stuck? Someone's personal web page, or usenet and mailing lists...
For anyone curious I tallied the votes from the linked page:
57 PHP HTML Preprocessor
29 PHP Hypermedia Preprocessor
98 PHP Hypertext Preprocessor1) Django
2) Rails
3) Cake
... BIG GAP ...
4) Node.js (Express)
Looking at this page I beleive I can still make a pretty decent website backend using vanilla php (including authentication) and a nice front end using plain old html and javascript from so many years ago.
20-25 years ago, everyone used tables for layout and random snippets of JS were scattered everywhere. HTML today has a much more expressive vocabulary as well as a whole suite of well-established best practices. Meanwhile, JS has evolved from a bunch of cute onmouseover handlers to an entire ecosystem in its own right.
It has improved markedly and while it still has it's warts modern PHP8 code is very different.
However the ecosystem has absolutely matured alongside it as well, Symfony and Laravel are excellent general purpose frameworks, composer is an excellent package manager etc.
It's what I write for my day job and while it'll never be my favourite language, it's a pleasant enough productive language and it pays the bills.
// Holy shit, is this the cleanest fucking frontend file you've ever seen?!
ubersearch($_GET, $embedded = false, $template = true);
lolGenerally at that time (and for a few years after) you still see a huge influence from C programming constraints in php.
Lot of extremely terse abbreviated variables and explicit looping. And for some fucking reason the pervasive believe that variable names need to be at most either 3 or 6 characters long. (Yes I know the reason it's still bad)
So yeah painful as it is to admit that is well above average expressiveness and readability for php of its era.
What a nice, whimsical message.
Back in the day, you could:
* Be bold enough to use Linux or FreeBSD and use CGI or Perl as the only free version
* Use ASP but pay license fees for Windows NT, ISS and SQL Server
* Use ColdFusion which was kind of trendy but was pretty expensive.
When PHP arrived it was so refreshing. I used to make my stuff in Apache+PHP, MySQL and Linux and it was magical what you could do with very few lines of code.
The worse part was to manually get the sources of the dependencies one by one, hit ./configure and make, so you can compile a php module for Apache
In those days Microsoft was pretty strong, everything used to be closed source and payed and that's why for people who understand what it was back then, this does not sound like the splashy announcements of today.
That's why every time you see Linus, Stallman or any person that was active in the open source movement, you should pay a beer to them. The world of technology owe a lot to them, specially the underdogs.
They were paying a lot for ASP and a shitty product(cant remember the name..it was something like WebObjects) that was taking too long to load, the newly born company i was hired for would cease to exist, so even thought i was hired as a sysadmin to manage the network, linux and databases, i've used my low skills as a programmer, without nobody asking me, and designed the thing in secret, in about two or three weeks with PHP, Linux and MySql instead.
The (news based, with a lot of personalization page) loaded in about 400 milliseconds instead of what once was a 10 seconds load.
My bosses were a little skeptic at first, because the ASP folks was a team formed with university professors and skilled pros, and i was a teen that was not even hired as a coder. Also it was so much faster that they thought i could only be cheating somehow (like static instead of personalized with data from a backend db)..
Linux and open source was also faced with skepticism, specially when confronted with Microsoft stuff that everybody was used to back then.
The LAMP stack was a wonder back in those days, and it helped a lot to popularize Linux, MySQL, Apache and PHP. I know today PHP doesn't look so cool giving all the other players, but in the context it was launched it was so much better than all the status quo of the nineties where the options were quite limited.
I've seen lots great, well structured and performant PHP code - the quality depends on the programmer, as it does for any other language.
The language is bad, but... you can still write great code in a bad language. And you don’t need a good language, or even good code to build a great website. Facebook has made more money with questionable PHP code than any site built with elegant pearl webscripts that I know of. Wikipedia is PHP. So was Digg (RIP). Your users don’t give a darn how good your language or code is so long as it usually works.
So tl;dr, PHP sucks, but I love PHP.
But it was slow (even after adding cache) and it need quite a bit of setup and libraries (CPAN with my own layers to make it easier to use), so I was very happy when I discovered PHP 3 (I did not know it existed before that).
Good memories; deploying a site cheaply by scp/rsync the files.
Well. I have a minio instance running for static small sites, every time I wanted to create a new bucket I had to re-read my own notes and fiddle around for half an hour with s3cmd and mc before getting something live. Today I threw the things out and started using scp again. It's much easier, it's not in the way.
I originally set up minio because I wanted to test out some backup solutions relying on S3 but I didn't want to use amazon (can't remember why). Turns out minio is great but not a 1:1 S3 clone and not every app can swap out amz for minio anyway.
I was thinking reading about ansible soon though.
My day job was Solaris/Linux work so I was used to it and I wanted PHP on my Mac, so I built the installer for myself and also put it on my website, where more and more people downloaded it from over the years.
I haven't used PHP in more than ten years and only recently started dabbling with web development again for fun. I am very happy with TypeScript + React on the client side and Python or Swift on the server side.
So, without a framework, I built my project in PHP and finished it in a week.
I remember that as a warm feeling...
FWIW, I no longer use DocBlocks because PHP's own type system is usually expressive enough.
I'd say it's one of the worst type systems. Expressive enough not to need docblocks, ok. Expressive as a type system: hell no.
Looking at that archived page brings back memories. Since I'd started with PHP/FI and I think I went on until 4.x, I'm pretty sure I saw that announcement when it actually came out.
And also remember how slow connections was back then so the progressive enhancement from square to round wasnt just a blink.
So many memories
Too bad 10 years had to pass before Uncle Bob came along :)
Clean Code, the book
I see the same with modern VB.NET. It's my go-to 'utility' language because I can knock up tools in it without having to think or look up code fragments. However it still has the stink of old BASIC on it for some reason and as such draws the distain of 'real' coders. I just don't get it.
I think it’s pretty stable and so doesn’t get a lot of mindshare. It not what the cool startups are using but it’s still used. With a framework like Laravel or symfony I enjoy working with it.