PHP-and-MySQL/C2/XAMPP-in-Windows/English-timed

From Script | Spoken-Tutorial
Jump to: navigation, search
Time Narration
00:01 Hello and welcome to PHP Academy.
00:04 I’m Alex and in this first basic tutorial, I’m going to take you through installing your web server. Installing PHP which comes with the package we’re going to use and also mysql which also comes with this package and we are going to be using it.
00:22 We’re going to use something called XAMPP. You can also call it ZAMP as that's how it’s supposed to be pronounced; however, I’ll just refer to it as XAMPP.
00:34 What you need to do is: to get your server up and running with your PHP installation and your mysql database, you’ll need to visit this website here.
00:46 Go to "apachefriends.org" or just google for "XAMPP".
00:52 It’s spelled like this here: X-A-M and double P.
00:58 And, I’ll just show you how to install it for Windows, how to get everything up and running for Windows installation.
01:06 If you need any other help on, say Linux or any other operating System, just let me know and I’ll be happy to make a tutorial.
01:15 So, we’ve come to the website and we need to choose this Installer here.
01:19 That will bring up this page and eventually you’ll end up with a file downloaded it like this one, with a version number.
01:29 First choose the Installer for that.
01:32 To install, just double-click and run and choose your language.
01:37 You may get this message, I’m using Windows Vista, so it says that "Windows Vista Account is deactivated on your system".
01:46 This isn’t necessary for what we’re using. So, ignore that if you do get that.
01:52 And you can just go ahead with your installation here.
01:56 Make sure you choose your own local drive with a folder to keep things simple. Don’t bother putting it in Program Files.
02:04 These options really are up to you. I'll check the Create a XAMPP desktop option. But I’ll not choose this one.
02:16 Now what you need to do is to choose to Install Apache as service and Install MySQL as service.
02:24 This will add it as a Systems Service and it will run every time you run your computer.
02:31 You’re welcome to keep these unchecked; I keep them checked for easy use.
02:36 And this is just going to install now. Now what I’ll do is leave that at that, I’ll pause the video and return when everything is installed.
02:47 Then I will take you through the rest of the setting up of your PHP installation.
02:53 Please note that before we install this, if I have a blank browser up here, and I try to acess localhost...
03:00 This is the local web server's host.
03:05 Usually you have a web address like "google dot com" but we are addressing this as "localhost".
03:12 You can see that we get a "Failed to connect" error message here.
03:17 But when we have installed XAMPP and we choose this localhost option again, we will, in fact, connect straight to our server.
03:26 XAMPP makes easy for us to install Apache which is http webserver and it will install php module on top of that and then install mysql database on the server.
03:40 So, when we come back to this after we have installed, running our localhost should work.
03:46 And I'll also show you how to put files into your localhost directory.
03:52 Its not called "localhost" but this is how we address our root server on our web server, a root folder, sorry, on our web server.
04:01 So, when that's finished installing, I will come back to the video and we can go ahead.
04:06 Okay, so we have finished installing and we have a few messages that just came up.
04:11 Just go ahead and click Finish.
04:14 You can see here that what we are checking is for necessary ports.
04:23 This means that it is checking port 80 and I think mysql.
04:27 However, as long as you have no errors here then you are absolutely fine.
04:32 You can see you're being set up with Apache 2.2 here.
04:36 And it looks as if the service is starting and also the mysql service is starting.
04:42 And we get a message saying that our installation is finished.
04:46 Now we can start the XAMPP control panel. You click Yes and we can bring that over here.
04:52 You can see that we've got our Apache server running and our Mysql server running.
04:58 The reason that you don't see PHP here is because PHP is part of our web-server and so part of Apache. It is installed as a separate module and not run as a service. Its more of a module addition to our web-server.
05:14 So, let's go and load our page back over here.
05:17 And you can see that by pressing Enter on localhost again, we've connected to "XAMPP" as you'll expect.
05:25 We can have a look inside a particular directory in our web-server as we usually would.
05:30 For now, just go ahead and click English.
05:33 And you can see that you have "XAMPP" set-up here.
05:37 Ok, now I'm going to open my "C" drive here and you can see it inside here.
05:42 And I'll click on XAMPP which is the installation directory we have installed.
05:49 We've got a few files here but the main one to focus is htdocs. This is where you put your files that are to be run by your web-server and processed in php.
06:02 So, if you double-click on this, you can see that we've got a variety of files here.
06:07 And this "index.html" is the file that you can see here. This is "index.php" for now, which is here.
06:15 And "index dot" anything in this file that's automatically started up.
06:20 You can change this but just leave it as that for now.
06:25 And, I've got a folder here called phpacademy.
06:29 What I'll do is, create a new text document. In fact, I will do this in my context editor as its a lot easier.
06:38 Let's get rid of this. Okay, so I'll create a new file.
06:44 I'll save that and that's saved to my "htdocs" folder here and I'll just save it as "phpinfo" and dot php.
06:53 And inside here, I'll type some php code.
06:59 And this will be "php underscore info" and you need 2 brackets, then you need a line terminator.
07:06 If you don't understand what this means, you don't need to learn it. It's not a standard thing that you need to know for everyday use.
07:14 This is just giving us some information of our PHP server or our web-server php installation.
07:20 So, we can come back to this and here we'll just address this; so you need "localhost".
07:26 And you don't need to type "htdocs" or anything like that.
07:29 All we need is "localhost" and we need to type in, lets see, what do we call our file: "phpinfo dot php". Press Enter.
07:42 We don't need the underscore. So take away that and you need to refresh.
07:50 You can see that we've got our php information file here with lots of data.
07:55 So, what is happening here is we are running a php script inside our htdocs file.
08:01 So, if I were to say address "favicon dot ico", you can see that we are getting that.
08:10 Any files that you put inside "htdocs" are processed by your web-server through php.
08:18 Any files that you write in the tutorials I have up here, just put them in "htdocs", a folder in "c : \ xampp and htdocs" and anything in there will be processed.
08:34 And you can address it either through localhost or 127.0.0.1. Pressing Enter you can see that nothing has changed. This is the same. This is just your local web-server.
08:50 We have installed "XAMPP" which is an easy way; short-cut way of installing your "Apache" service and your "mysql" service which is your database service you will use later on and also the "php module" for "Apache" which lets you process php files; obviously, that's very useful.
09:10 We've downloaded and installed XAMPP and I've shown you how to create a file and run this through your web-server.
09:16 So, hopefully this will be of use for you to start with the tutorials. If you have any problems feel free to contact me.
09:23 Please subscribe and I'll see you in the tutorials to come. Thanks for watching!
09:26 This is Joshua Mathew, dubbing for the Spoken Tutorial project. (Script contributed by Bhavini Pant and Nancy Varkey).

Contributors and Content Editors

Gaurav, Minal, PoojaMoolya, Pratik kamble, Sandhya.np14, Sneha