Running PHP 1.0 in 2024

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
PHP is now 29 years old can you even imagine how the world looked like in 1995 no Google no Facebook no chat gbd or co-pilot no a a and developers were trying to build websites in SE language well at least they didn't have to choose a JavaScript framework anyway to celebrate php's 29th birthday let's dive deep and experience the very first PHP version in history pH PP started as a set of programs written in C known as PHP tools which stood for personal homepage tools it was much later when the project evolved into a true interpreter that the PHP acronym came to stand for hypertext pre-processor Rasmus lorf the author of PHP created and released php1 to the public in June 1995 he may not have realized the impact his project would have on the world of the web development oh sh I think I like PHP anyway back then there was no GitHub in fact it itself wouldn't appear for another 10 years there were no services for open source distribution even the term open source didn't exist yet so the author of PHP first announced his project on the uset news group and if you're not familiar with news groups they were like the Reddit of those days Rasmus originally created PHP just for himself to simplify managing his personal website and deliver client work faster I put together all my common stuff into a C library hacked it into the NCSA web server and then added a little templating system on top of that to let me easily call into it and that was the first version of PHP oh my goodness let's try running PHP 1 after nearly 30 years okay let's go all versions of PHP including the earliest ones can be found at the Museum of PHP let's download the very first version and unze the archive even though there aren't many files there is a readme and it has installation instructions it says that complete instructions supposed to be available on this website which of course does no longer exist okay let's see the config Doh file it has several macros defined so let's update the first one now we can run the make Command which will compile the four CGI programs at this stage it's not clear what each program is responsible for we'll try them out to find out but we need a CGI web server to make it work and in 1995 the most popular was NCSA httpd which became the basis for the Apache HTTP server later the same year we'll do something completely different we'll Implement a very simple CGI web server using modern PHP but what is CGI CGI or common Gateway interface is a standard that allows a web server to pass user requests to external programs for processing and then return the results back to the user the standard appeared in the early '90s and was popular until the early 2000s anyway let's look at the PHP implementation I'll do speedrun you can find the sources by the link in the description if you want to see all the code so I create a class which takes address and port and it will have a run function in this function we initialize the socket and start listening to incoming connections then in an infinite Loop we handle the requests we need to par the request to get URL and body and then we'll process the request basically for each request we run an external program which in our case is php1 and whatever that program prints out we capture the output and send it back to a user and that's all we need now let's run our CGI server php1 and analyze it phpl do CGI is the main program that handles rendering HTML Pages access control and Zing page visit statistics it expects path to a file as a parameter so let's create an index.html file and let's try opening it as you can see it's pretty much just HTML but with some info about visits the PHP added at the bottom does this have any templating capabilities well sort of it can render a few building variables for example there is a version variable and the syntax is following so it's pretty much like HTML commands it can also do a bit of Access Control let's say we want to have a page protected. HTML which is only accessible by password in this case we can add a file with the same name but ACC extension and we specify that it's a private page and it requires email and password and if we go to see the page P after entering the email and password we can access the [Music] content another program that comes with php1 is PHP f. CGI it is responsible for processing form data so let's add a simple feedback form where users can enter their name and message we need to specify phpf CGI question mark form in our action attribute of the form now when we submit the form the submitted data will be written to a do rest file in the forms folder the other two programs are more for admins phpl lm. CGI is a program for processing logs and displaying page visit statistics and phpl view. CGI provides more detailed statistics on each page the data is taken from dolog files which are also written by phpl doc [Music] GI and that my friends is php1 a small set of tools for controlling access keeping visitor statistics and saving web form data PHP has come a long way and today it's a great programming language with a mature and vibrant ecosystem but one thing remains unchanged PHP is a productivity tool it is pragmatic and allows deliver and results fast my name is Roman pronsky I work for the PHP Foundation a nonprofit organization that develops the PHP language hope you like the video and see you next time
Info
Channel: Roman Pronskiy
Views: 15,705
Rating: undefined out of 5
Keywords:
Id: 0BPExYh5Anw
Channel Id: undefined
Length: 7min 4sec (424 seconds)
Published: Mon Jun 10 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.