PHP - Introduction to PHP + Apache + MySQL

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
this will be a brief introduction video to PHP and how to go about starting using the language now pH P stands for PHP hypertext preprocessor which is a recursive acronym and the original name was personal home page it is basically an engine that processes scripts on the server side instead of the front end or client unlike JavaScript that actually requires a browser to do the work PHP does it on the server side so we can briefly illustrate this by this example we've got a server you've got your home computer sorry from my drawing it's not that good and what we're doing here is you've got your your browser it's a fox or and EU whatever so HTML and JavaScript amongst other scripting languages such as VB script script run on the actual browser side and PHP some of the dotnet languages and dotnet framework amongst others run on the server side so when you lower the website what you're doing is it goes through the server this executes the scripts and returns HTML so what you're getting is HTML and JavaScript on your client and the server is doing all the hard work of figuring out what to display and everything in some cases let's say you're using the website is only HTML based so what you do is it FETs it fetches the HTML from the site and displays it in your client what PHP gives an extra layer to this allowing a much richer feedback between the client and the server so let's say what's doing here is the server is divided into several components and it might be good to illustrate these and the role that PHP has so what you've got is your web browser you load a website up so you go into the website to the server I mean and the first layer is Apache which is the web server now you load this website let's say you've loaded index dot PHP so it goes to the website applied to says oh it's a PHP file what do I do well I need a PHP program to process this website so it loads up the script in PHP PHP returns it processes the actual page the context the script and returns the HTML back to apache and i purchases oh i can i can deliver this back so it goes here you go and your web page is rendered now we can add an extra layer onto this because PHP in apache by themselves well usually want to store data from users and maybe i have a user account or give richer content to your website so you can have a database system so my sequel is commonly used for this as it's really easy to integrate both of these just as it is to integrate PHP in a batch so my sequel is a database handler management system and the extra level of integration you get is when you're computing this PHP script you can make calls for the database return data process it and finally deliver that data in a readable structure as HTML and return it to that to their client browser so as you see it's a fully integrated system we've got here and it's quite useful to do server-side processing all of this without the client even knowing anything about this the user doesn't have to have knowledge about this and the browser doesn't have to handle all that programming stuff the servers which are usually much more capable handling such tasks does all the hard work and just deliver us back the HTML so now you've got a brief understanding of what system we require I'm going to show you an easy way of installing these free programs now there's various way to do it there's a manual installation and there's packages that come with everything pre-installed basically so we are going to check out first of all we've got one server which is Apache PHP and my sequel all in a package ready to go you can get out one server comm /e M for English and another option is USB web server which is a smaller package you don't have to actually install it and you can even take it with you on a USB stick or any other format this is quite useful if you're actually going to go and show a demo at a client's site or or maybe a school presentation for example so you just go to USB web server without net click on download and click on the English version and what you'll get is our zip file containing this when you open it up the first time you get these files now it might be good to actually note that there's another way of installing it which is the manual installation you can find this at php.net just click on documentation at the top go to english go to installation on whatever platform you're using if you're using windows click on that and go to manual installation steps and it will give you a detailed guide on how to install PHP how to link it up with Apache and obviously you'll have to download Apache PHP and if you're going to use a database system such as my sequel download it separately and you got to go basically after linking them up if you want to avoid all those hassles just one of the these packages which I wouldn't recommend in an actual production environment but if you're just going to be developing then it's much easier to do this so once you've got your package such as USB web server you end up with this Exe file and a few folders including all the programs that's going to need you double click on this the first time and it will probably ask you if you want to allow yeah here we go access for my sequel and for Apache you have to allow access to the computer and we get a green symbol here in Australian diets up and running we've also got up default port set up 80 is the default web port for websites however we're using 8080 here because in many windows installations you've also go a is installed which is Microsoft's web server so we're using this alternate version here so you display our website and we're going to start with a really quick example of how to use PHP so we start off with this which is the document root I'll just go and delete all these items create a new text document it's going index dot PHP and I'm going to edit it you might want to choose notepad plus plus ask your default editor for PHP files because it's much better than a standard notepad so how do we go about writing a PHP script well the most important parts are the start and end tags to start a PHP script and to end it we use these symbols this is a standard now there's some shortcuts such as doing it this way but it depends on your PHP configuration if you've got it set to do it up to do so so if you've not it's just better to go then the easy way and do it the right way let's say so let's do a hello world program so simple as this echo and in quotes hello world and use a semicolon at the end to illustrate that's the end of a command I'll save this file now come back to USB web server and I'm going to click on localhost to open it up in the browser and as you can see we've got hello world that means PHP has been installed correctly it's linked up with a path trip and you'll see the address is 8080 as we saw in the settings and you can change this port to any other number obviously if you're going to want outside access from the internet you're going to have to open the 8080 port on your firewall but be careful with doing so as well security etc so that's the basic introduction and we'll get into detail on actually developing PHP scripts in the next video you
Info
Channel: lemiffelearning
Views: 68,437
Rating: undefined out of 5
Keywords: php, mysql, apache, introduction, lemiffelearning
Id: jOFo3Y_3wwg
Channel Id: undefined
Length: 12min 15sec (735 seconds)
Published: Wed May 04 2011
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.