PHP was invented almost by accident by Rasmus Ledorf for presenting his website with some active content. Well, it's become *very* active! The name originally meant Personal Home Page, but as it grew far beyond that, Rasmus and friends had to come up with a different name that was still spelled as PHP. They came up with HyperText Processor, or something similar, but it didn't matter much because by then everybody just called it PHP.
PHP code is hidden inside an html page much like comments are. Comments – <!- this is a comment –> PHP code – <?php echo “Hello, World, this is php code!” ?>
This embedded code can be processed by a module built into the apache webserver. In other words, apache has received a request from somebody's web browser for a certain page. Apache goes to fetch it, and notices that the name of the file is somefile.php. Apache figures it must be a php file, and passes the file to the php module. The php module executes the php code. At its simplest form, this code expands something into html-style text. Then the module hands the page, now containing a bunch of expanded html, back to the apache webserver, who then sends the completed page off to the web browser that wanted it.
PHP has several strong points that have made it popular: 1) It is a scripting language rather than a coding language; that means you can write a little and it does a lot. 2) It has wonderful integration with many database packags; that means it's easy to store and fetch things. 3) It is free.
A parallel free product (MySQL) is a database that also turned out to be powerful, fast, and free. As a pair, PHP and MySQL are a dynamic duo. It is very convenient to program active web pages using a combination of the PHP language and the MySQL database manager.
And suddenly, the web page has become an easy-to-use, widely-available, graphic front end to almost any kind of programmed application, running on a webserver. And still, for the programmer, fairly simple to use, powerful, and free.