I Love LAMP

Giving some well-deserved appreciation to the LAMP stack, a key building block of the modern-day internet that you use daily. It’s everywhere. It may never die.

Today in Tedium: A huge portion of the internet is brought to you by open-source software, and a good chunk of that open-source software doesn’t get its due outside of programming circles. Programmers are constantly looking for new ways to skin a cat, but too often, we don’t take a step back to consider how democratizing the code itself was—how it made once-difficult tasks approachable by mere mortals. One of those programming languages is something that is used by nearly 80 percent of sites on the internet, and a huge chunk of the people using that programming language on their server are using three key tools—the operating system Linux, the HTTP server Apache, and the database system MySQL. Together these tools combined with PHP into one of the greatest killer apps the open-source community ever produced: the LAMP stack. (Get it?) Today’s Tedium shines a light on LAMP, the background tools that, together, turned the internet into a machine that anyone could run. — Ernie @ Tedium

The Prepared is a newsletter for non-engineers who love engineering

Every Monday, The Prepared brings you the best stories about manufacturing, engineering, and infrastructure. In this week’s issue, we cover route setting for rock climbing, guerilla public infrastructure, and mysterious radio stations used for espionage. Subscribe today!

Today’s Tedium is sponsored by The Prepared.

1995

The year that the three key elements of the LAMP stack, the database MySQL and the Apache HTTP server, were first developed. (Apache saw its initial public release in April, and PHP emerged in June. MySQL’s timeline is hazier, but it’s generally accepted that development started in 1995.) These technologies came from different parts of the technology world, with Apache an offshoot of the same University of Illinois research center that berthed the Mosaic web browser, PHP being initially developed by a Canadian developer, and MySQL being born from a Swedish company. All of these tools, particularly MySQL, gained adoption with very large companies, who offered their own resources to develop the platforms over time, while organizing foundation behind Apache became one of the most fundamental in open source.

An O’Reilly book on PHP and MySQL. The well-known tech publishing firm is responsible for popularizing the LAMP stack, which refers to Linux, Apache, MySQL, and PHP in its best-known form.

Why LAMP was (and is) so fundamental to the modern internet

In a lot of ways, the LAMP stack was an idea already in practice that just needed a little bit of branding goodness. It was an idea that needed a little push—and that push was enough to outdo competing commercial products from players as large as Microsoft and Apple.

But despite only getting a fairly modest push compared to the sheer scale of the major companies it competed against, LAMP stack still rules the roost.

The terminology dates to around 2000 or 2001, with David Axmark and Monty Widenius, two of the cofounders of the relational database MySQL, credited for making the initial connection between the various parts into a combined service that could be sold to developers as an open-source framework. After the developers met with staffers at the publishing firm O’Reilly Media, the firm—which specializes in technical learning manuals that target programmers and IT departments—had embraced the term, evangelizing what it meant to the broader digital community.

This was a smart move on the part of Axmark and Widenius: O’Reilly Media is considered widely responsible for popularizing some of the most important terms in digital technology—including “open source,” “Web 2.0,” and the “Maker movement.”

In a 2001 article for the company’s ONLamp.com website, O’Reilly cofounder Dale Dougherty admitted that a similar kind of branding work was at play with LAMP.

At the O’Reilly Network, our editors have been discussing how to unify and focus our open source coverage. As you know, open source covers a lot of ground, and it can be hard to identify those common areas where developers converge. Too often, the market identifies open source with Linux, and Linux is already well covered on many sites. We have felt that the market has ignored the tools that make Linux a great applications development platform, especially for robust web applications that run on Linux servers.

The lightbulb that went off in my head was that LAMP represents the open source web platform. Most importantly, LAMP is the platform of choice for the development and deployment of high performance web applications. It is solid and reliable, and if Apache is any indicator, then LAMP sites predominate. If you visit the Netcraft survey and look up popular sites, you’ll notice that many run Apache on Linux, and have either mod_perl or mod_php installed. (Netcraft is unable, using its methodology, to detect sites that use MySQL, but we feel comfortable, knowing the number of MySQL downloads, that this open source database is making significant inroads on proprietary databases, especially for web applications.)

Dougherty noted that, when thinking about it in these terms, it was clear that O’Reilly was already using LAMP for its own content management platforms and tools.

PHP, basically by accident, became one of the world’s most popular programming languages. (Shahadat Shemul/Unsplash)

In fact, the only thing that O’Reilly really didn’t sell about the LAMP concept in the end was the idea that the programming languages Python and Perl would be languages generally referred to when using the term, along with PHP. At the time LAMP came to life, see, PHP was on a major upswing—and that growth would only continue to strengthen over time, with many of the most popular applications produced in the mid-2000s reliant on the language.

For years, LAMP stacks had natural advantages for end users, as their ubiquity allowed for the rise of web hosts that could offer cheap processing and storage for PHP-based services, meaning you could have a working interactive website for maybe $5 a month or less, depending on the size of the app and its use case.

That was democratizing—and allowed bedroom experimenters and large corporations alike to try new things online, outside of a walled garden. For the average consumer, the types of tools that won out allowed them to create polished presences for their businesses or creative work with a relatively limited amount of fuss.

It was a compelling pitch, and it remains the prevailing one on the modern internet. If you heard developers, though, you’d be surprised to learn the most popular kind of development environment generally has a bad reputation.

There are a lot of reasons for that.

“I don’t think it is deliberate that PHP gets very little press. PHP is about as exciting as your toothbrush. You use it every day, it does the job, it is a simple tool, so what? Who would want to read about toothbrushes?”

— Rasmus Lerdorf, the initial creator of PHP, in a 2002 interview with SitePoint, discussing the language’s under-the-radar status, despite its ubiquity in the web’s middle years. PHP is a strange beast, as it was not intended to be a general-purpose programming language in its initial release, but simply a way to add interactive features like guestbooks to web pages. The language has taken many forms over the years, with a focus on speed a major component of its recent evolution—as PHP long had a reputation of being slow as a dog.

Facebook’s reliance on a LAMP stack in its initial form has largely led to many efforts to modernize the PHP language to match its massive scale.

Five popular web tools that you use today that were initially built using PHP

  1. WordPress. This is kind of an obvious one, as it was and is far and away the world’s most popular web-based application, with more than a third of all modern-day websites reliant on it and some way, shape, or form. Most LAMP sites in the wild are running WordPress. While WordPress remains strongly in the PHP camp, its parent company, Automattic, has taken steps to implement more JavaScript into the system through WordPress’ REST API, an application programming interface, while further updating the infrastructure.
  2. Facebook. Mark Zuckerberg, love him or hate him, is responsible for what’s by far the world’s most popular PHP-based application, a tool that spies on you, sucks up your attention, and is considered a threat to democracy. But in 2004, before the tide turned against Facebook, Zuckerberg developed his product using a traditional LAMP stack—which, for all of its faults, allowed Zuck to get something built quickly. Eventually, PHP proved too limiting for an application of Facebook’s size, and the company developed two tools that allowed it to get around the language’s weaknesses—HipHop Virtual Machine, a compilation layer that converts PHP to C++; and Hack, a derivative of PHP that modernized the language for the company’s needs.
  3. Wikipedia. If Facebook is the most popular PHP-based application in wide use, Wikipedia is a close second, with an engine that must not only withstand a lot of reading, but constant editing. At its core is an open-source content management system for wikis called MediaWiki, which has this wonderful way of describing PHP: “PHP is a web template system that accidentally grew up into a fairly general language.”
  4. Tumblr. While the social network is certainly not at the peak of its powers anymore, it was also built with elements of a traditional LAMP stack, according to the blog High Scalability, and the network’s engineering has kept up with the times, updating to more recent versions of PHP in recent years. (Its former owner Yahoo, by the way, is also a PHP shop.)
  5. Slack. The work-focused chat tool is way newer than most of the platforms mentioned here, but it, too, uses PHP on the server side. What gives? In a 2016 blog post, the company’s chief architect, Keith Adams, explained that while PHP as a language has some serious flaws, its development as a web-first environment makes it particularly useful for large-scale web applications. “The success of projects using it has more to do with properties of the PHP environment, and the high-cadence workflow it enables, than with PHP the language,” he wrote. “And the advantages of that environment (reduced cost of bugs through fault isolation; safe concurrency; and high developer throughput) are more valuable than the problems that the language’s flaws create.”

The LAMP stack is everywhere—but nobody seems to love it anymore

The interesting thing about LAMP is that, pretty much the entire time it’s been in popular use, developers have been trying to move away from it for various reasons.

With the exception of Linux, whose flexibility and open nature has proven the fundamental glue for modern development, each of the LAMP tools have issues significant enough that developers have been trying to find ways around them for years.

PHP, for example, has traditionally been seen as a language with a low barrier of entry that can easily be misused in the wrong hands and has serious syntax flaws, meaning that there’s a lot of low-quality PHP code out there. Apache, meanwhile, has long had a reputation of being fairly heavy and aggressive with memory use, which is not a thing that people want out of their servers, and has led to the uptake of competitors like Nginx. (There is a well-known LAMP alternative called LEMP, which replaces Apache with Nginx.)

And then there’s MySQL, which has maintained many of its technical advantages over time even as competitors have appeared, but has an imperfect reputation within the open source community due to the fact that it’s generally distributed as free software, but not fully open source—requiring those who would like to work on the code to sign a contributor agreement before they can work on it—despite the fact it was originally sold that way. (These days, it’s owned by Oracle, which has had a complicated historical relationship with open source, as seen in the form of its long-running lawsuit against Google over Android.) This situation actually led to the creation of a widely used fork of MySQL called MariaDB, which was created by Monty Widenius in direct response to the Oracle purchase.

For one reason or another, alternate approaches to development have slowly become key to the way we develop things online. There is a pretty strong case that, for example, if Mark Zuckerberg had developed Facebook in 2005 or 2006, he might have gone with a different programming approach, as by that time, formidable alternatives to PHP had emerged, including Ruby on Rails. A few years after that, and Facebook might have been fully JavaScript-based.

But because PHP is used by such utterly massive companies, it’s led the legacy language and environment to constantly improve.

Modern developers often don’t have a great opinion of LAMP stacks, despite the fact that servers that rely on it are just about everywhere, and buying access to one is trivial. For all the technical advantages that come with spinning up a site using the server-side JavaScript runtime environment Node.js, you can often get a PHP-based site online without ever having to dip into a command-line interface or knowing what Git is—which eliminates a pretty significant barrier of entry, even though there are a lot of advantages to gaining fluency with the command line or using Github. Heck, many PHP-based CMS platforms don’t even require you to know much more than HTML and CSS to customize things.

Development paradigms are constantly evolving and changing, and if you’re a full-time developer, keeping those skills up to date is important. But many people aren‘t, and these shifting paradigms, while generally good for the modern web, leave amateurs who just want to create something useful behind. The LAMP stack, for all its modern-day weaknesses, lowered the bar to entry in a way that modern technology stacks often have not.

Fortunately, folks are working on this specific problem—see the great work being done at Glitch, for example. But even if the broader technical community looks at LAMP as something of a relic, it nonetheless serves an important role.

LAMP is the fluorescent lightbulb of the internet. It’s utilitarian and does its job well, even if it doesn’t have the glow of an incandescent light nor the novelty of an LED bulb. It’s there when you need it.

In a lot of ways, I think the equation around the LAMP stack has changed over time.

For my own personal purposes, I spent years pushing away from the traditional LAMP stack, only to find myself growing to appreciate it again a couple of years ago, when I started looking for a replacement content management system for Tedium. I started with a traditional WordPress setup with my old site, ShortFormBlog, but found issues with stability and technical capabilities as that site grew, and that led me away from LAMP.

I was a fan of Tedium’s old CMS, Ghost—still am—and I had been looking into the idea of using a static site generator like Hugo or Hexo, but I ultimately came to the conclusion that, at the time, nothing out there really was at the level of prime time I needed to both publish a newsletter and a website in one fell swoop. (Ghost has since improved on this front, but I still say I made the right move away from it for my personal needs.)

I only came back to LAMP-based platforms begrudgingly, after focusing on technologies built on more modern development paradigms such as Node.js and Go, and found that I had severely underestimated the capabilities and strengths of what could be done with good old PHP and MySQL. I landed on Craft CMS, which has proven a flexible-but-stable basis for the work I do twice a week.

But there were compelling systems built on a LAMP paradigm that I saw a lot of potential in, such as Statamic. I got relatively far with OctoberCMS before deciding its smaller community would prove a liability when I inevitably screwed something up, for example. (This actually turned out to be an astute point, as OctoberCMS changed its licensing policies earlier this year.)

But I think the more interesting factor is that the technologies around digital apps are starting to converge in a way that mitigates the weaknesses of the LAMP stack. A lot of monolithic content management platforms, including Craft, have recently been adding native support for GraphQL, a data-manipulation language created by Facebook and managed by the Linux Foundation. It effectively allows programmers to turn any site into a modern API.

This has evolved in a fashion that allows traditional content management systems to be used in a “headless” manner, where the parts that work really well (the backend interfaces that allow you to elegantly write and manage content) are effectively separated from the parts that traditionally struggle with speed and security (the front-end interfaces that have to distribute that content to thousands or even millions of people). Previously, a CMS had to do two things well; in the future, the CMS will only have to do one job—and it will need far less horsepower to do that job well.

The result is that developers can manage data produced by older technologies, such as those built on LAMP stacks, however they want—in mobile apps, or through barebones “static” sites that don’t rely on a public server. I’m not personally looking to make a shift like that right now with my own site, admittedly, but I find the fact that modern technology has found a way to make these older approaches relevant again to be fairly heartening.

To put this all in layman’s terms: It puts older web technology on equal footing with modern web technology.

Now, don’t get me wrong—the LAMP stack is often unloved for a reason. It’s a 2001 design paradigm in the modern era, and often loses out on some of the advantages that we’ve gained since. But just because it doesn’t have those modern upsides doesn’t mean it’s all downside.

Far from it.

--

Find this one an interesting read? Share it with a pal! And thanks again to The Prepared for their support over the past month. Give them a subscribe!