- Introduction to PHP

Introduction to PHP

State of Personal Homepages in the Early 90s

Most personal websites of the early 1990s, as exciting as they may have been, could be best described as hobbyist efforts. Beyond the steep learning curve of HTML (and later CSS), one would also have to spend a considerable amount of time procuring and setting up a web server that would host the web pages, and even then, the final results were "unfinished and chaotic" and would become quickly obsolete as these websites offered little beyond fun novelty.

These HTML-only websites also had a fatal flaw: lack of scalability. While creating a three-page personal website using HTML would be a simple task, the project quickly devolves into a complex mess once we introduce a bigger set of pages that share a set of common elements. Can you imagine creating around hundred HTML pages for your new own State of the Union website, all manually linked together using hyperlink, only to realize that you made a mistake in your 24th page that you have been replicating for the past 5 hours?

Early History of PHP

The Web remained a promising ecosystem for everyone, and individuals and companies continued to publish their content, slowly experimenting through the process. While the general public continued to struggle with HTML and CSS using their text editors, companies and passionate hobbyists created adhoc solutions to improve their products.

Web publishing may have been in its infancy, but other realms of computing advanced over the past few decades: government organizations received help from database solutions and automation, and programming languages started to receive widespread use as personal computers became more ubiquitous. There was a clear opportunity in the web industry: HTML could benefit from a programming language, so that users could create large-scale websites that can easily connect to databases and automate other manual and redundant human efforts.

PHP was initially introduced as Personal Home Page Tools in 1994 (early syntax above). While first designed as a series of tools and scripts that help augment an existing static website, PHP grew to have a life of its own as a standalone programming language and renamed itself with a recursive acronym: PHP: Hypertext Preprocessor.

PHP Dominance

Since its inception, PHP enjoyed an overwhelmingly positive response from its critics and users from both personal and enterprise domains, with its unfettered dominant market share in the industry. The market share continues to hover around 80%, as new web programming languages continue to challenge its dominance.

Critics attribute PHP's success to its ease of use and the LAMP architecture, whose name refers to popular open-source technologies (Linux, Apache, MySQL, and PHP) used to host websites. Due to its origin as a "programming language" layer on top of HTML, PHP enjoyed popularity among developers who are already well-versed in HTML and CSS and wished to experiment with programming languages with little to no investment.

WordPress, MediaWiki (ex. Wikipedia), Facebook are some of the most notable large-scale systems that heavily rely on PHP, even contributing back to the open source project. PHP is currently at major version 7, with each update receiving major security and performance boosts.

Vulnerabilities and Future of PHP

Perhaps due to its widespread (and premature) adoption, PHP accummulated its reputation as a less secure programming language. This flaw is little associated with the core language itself, but rather due to omission of service upgrades or programming mistakes: the issue can be especially more severe, when popular service providers (such as GoDaddy) fail to keep their affordable web environments updated.

As younger developers enter this constantly shifting market, they feel less compelled to use PHP as the primary language of choice as one may be interested in using more abstract frameworks (such as React or Angular) that perform more heavy-lifting than a combination of HTML-CSS-PHP. However, as HTML and CSS continue to serve as the first step in learning about web design and development, PHP will enjoy its success as a "conceptually simple" programming language.