From Script | Spoken-Tutorial
Revision as of 15:43, 29 July 2013 by Sneha (Talk | contribs)

Jump to: navigation, search
Time Narration
0:01 Hello and welcome to PHP Academy.
0:04 I’m Alex and in this first basic tutorial, I’m going to take you through installing your webserver, installing PHP which comes with the package we’re going to use and also mysql, which also comes with this package and they are going to be use it.
0: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.
0: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.
0:46 Go to "" or just google for "XAMPP".
0: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 Window, 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 make get this message – I’m using Windows Vista, so it’s 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 a service" and "Install MySQL as a 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 webserver'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.
3:17 But when we have installed Xampp and we choose this localhost option again, we will, in fact, connect straight to our server.
3: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.
3:40 So when we come back to this after we have installed, running our localhost should work.
3:46 And I'll also show you how to put files into your localhost directory.
3:52 Its not called localhost but this is how we address our root server on our webserver, a root folder, sorry, on our webserver.
4:01 So when that's finished installing, I will come back to the video and we can go ahead.
4:06 Okay, so we have finished installing and we have a few messages that just came up.
4:11 Just go ahead and click "Finish".
4:14 You can see here that what we are checking for necessary ports.
4:23 This means that it is checking port 80 and I think mysql....
4:27 However, as long as you have no errors here, then you are absolutely fine.
4:32 You can see you're being set up with Apache 2.2 here.
4:36 And it looks as if the service is starting and also the mysql service is starting.
4:42 And we get a message... saying that our installation is finished.
4:46 Now we can start the XAMP control panel. You click "Yes" and we can bring that over here.
4:52 You can see that we've got our Apache server running and our Mysql server running.
4:58 The reason you don't see PHP here is because PHP is part of our webserver and so part of Apache. Its installed as a separate module and not run as a service. Its more of a module addition to our webserver.
5:14 So, lets go and load our page back over here.
5:17 And you can see that by pressing Enter on "localhost" again, we've connected to "XAMPP", as you'll expect.
5:25 We can have a look inside a particular directory in our webserver as we usually would.
5:30 For now just go ahead and click English.
5:33 And you can see that you have "XAMPP" set-up here.
5:37 Ok, now I'm going to open my "C" drive here and you can see it inside here.
5:42 And I'll click on "XAMPP" which is the installation directory we have installed.
5:49 We've got a few files here but the main one to focus is "htdocs". This is where you will put your files that are to be run by your webserver and processed in php.
6:02 So if you double-click on this, you can see that we've got a variety of files here.
6:07 And this "index.html" is the file that you can see here. This is "index.php" for now, which is here.
6:15 And index dot anything in this file that's automatically started up.
6:20 You can change this but just leave it as that for now.
6:25 And.... I've got a folder here called "phpacademy".
6: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.
6:38 Lets get rid of this. Okay so I'll create a new file.
6: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.
6:53 And inside here I'll type some php code.
6:59 And this will be "php underscore info" and you need 2 brackets then you need a line terminator.
7:06 If you don't understand what this means, you don't need to learn it. Its not a standard thing that you need to know for everyday use.
7:14 This is just giving us some information of our PHP server or our webserver php installation.
7:20 So we can come back to this and here we'll just address this, so you need "localhost".
7:26 And you don't need to type "htdocs" or anything like that.
7: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.
7:42 We don't need the underscore. So take away that and you need to refresh.
7:50 You can see that we've got our php information file here with lots of data.
7:55 So what is happening here is we are running a php script inside our htdocs file.
8:01 So if I were to say address "favicon dot ico", you can see that we are getting that.
8:10 Any files that you put inside "htdocs" are processed by your webserver through php.
8:18 Any files that you write in the tutorials I have up here, just put them in "htdocs" folder in "c : \ xampp and htdocs" and anything in there will be processed.
8:34 And you can address it either through localhost or Pressing Enter you can see that nothing has changed. This is the same. This is just your local webserver.
8: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.
9:10 We've downloaded and installed "XAMPP" and I've shown you how to create a file and run this through your webserver.
9: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.
9:23 Please subscribe and I'll see you in the tutorials to come. Thanks for watching!
9: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