A Beginner’s Guide To LAMP Stacks
To build a new website or smartphone app, a suite of complementary software platforms is required to underpin visual content. And since the Millennium, one combination of components has become unofficially established as the default option. Despite being unrelated in origin or purpose, this quartet of elements works harmoniously together to support the creation of new online content. Indeed, one of the few shared similarities is their open source nature – each is available at no cost, ready to be used without restriction.
Stacked up
The first element in a flexible and powerful LAMP stack is the Linux operating system. It comprises a variety of competing versions (known as distros), which are largely incompatible despite sharing the same basic architecture. More positively, Linux delivers a level of flexibility lacking in the rival Microsoft Windows and Apple macOS platforms. It underpins the installation and running of every other layer in the LAMP stack, through a package manager which is generally bundled in with a particular distro.
Sitting on top of Linux is the Apache web server. This regulates space on a server where the website or application’s various contents are housed. Apache translates requests prior to serving up relevant content over the HyperText Transfer Protocol common to most internet traffic. Used for the majority of web server applications, Apache is easily configured and endlessly adjustable to suit specific functions such as developing analytics packages. It’s also very reliable – a critical attribute for any always-available resource.
The next component in a LAMP stack is a database management system, capable of interpreting raw data. Imagine an ecommerce clothing site, where every item is available in different sizes and colours. MySQL is ideal for storing information and handling dynamic content, having been endlessly modified and fettled since it was launched (within weeks of Apache) in 1995. Despite requiring significant volumes of storage space in order to function, MySQL easily scales up as visitor volumes increase.
A stack is concluded by the presence of a scripting language, displaying information on a device’s screen or in a web browser. Known by the abbreviation PHP, Hypertext Preprocessor shares many similarities with HTML. It can be embedded into HTML code for near-universal device compatibility, though it offers more scope than HTML in terms of dynamic content such as forms. PHP has grown in popularity, as websites evolved away from basic text and image content towards more immersive media-rich platforms.
Real-world implementations
Although you might not realise it, LAMP stacks recur across cyberspace. They power user-generated platforms like Wikipedia and Facebook, as well as underpinning the world-leading WordPress CMS. Stacks can comfortably handle streaming media services and their curated algorithms, or deliver key functionality to Android apps such as sharing databases. Because all four elements are open source, developers are allowed to customise them so they meet their own specific criteria or targets. This is useful in situations where no framework exists for a new service, and the LAMP hierarchy has been used to develop many industry firsts.
Going off-script
Because these stacks are open source, there are various ways of configuring them. Linux can be exchanged for Windows or Mac OS, while MySQL could be replaced with the increasingly popular MongoDB. Equally, Python, and Perl both serve as PHP substitutes. Given the importance of JavaScript in smartphone applications, the rival MEAN stack has gained popularity with developers of cloud-hosted packages in particular. Yet the quartet of Linux, Apache, MySQL, and PHP remains the default choice when building applications or developing online content.