Hello and welcome to PHP Academy.
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.
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.
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.
Go to "apachefriends.org" or just google for "XAMPP".
It’s spelled like this here: X-A-M and double P.
And, I’ll just show you how to install it for Window, how to get everything up and running for Windows installation.
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.
So, we’ve come to the website and we need to choose this Installer here.
That will bring up this page and eventually you’ll end up with a file downloaded it like this one, with a version number.
First choose the Installer for that.
To install just double-click and run and choose your language.
You make get this message – I’m using Windows Vista, so it’s says that "Windows Vista Account is deactivated on your system".
This isn’t necessary for what we’re using. So ignore that if you do get that.
And you can just go ahead with your installation here.
Make sure you choose your own local drive with a folder to keep things simple. Don’t bother putting it in Program Files.
These options really are up to you. I'll check the "Create a XAMPP desktop option". But I’ll not choose this one.
Now what you need to do is to choose to "Install Apache as a service" and "Install MySQL as a service".
This will add it as a Systems Service and it will run every time you run your computer.
You’re welcome to keep these unchecked; I keep them checked for easy use.
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.
Then I will take you through the rest of the setting up of your PHP installation.
Please note that before we install this, if I have a blank browser up here, and I try to acess localhost...
This is the local webserver's host.
Usually you have a web address like "google dot com" but we are addressing this as "localhost".
You can see that we get a "Failed to connect" error message here.
But when we have installed Xampp and we choose this localhost option again, we will, in fact, connect straight to our server.
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.
So when we come back to this after we have installed, running our localhost should work.
And I'll also show you how to put files into your localhost directory.
Its not called localhost but this is how we address our root server on our webserver, a root folder, sorry, on our webserver.
So when that's finished installing, I will come back to the video and we can go ahead.
Okay, so we have finished installing and we have a few messages that just came up.
Just go ahead and click "Finish".
You can see here that what we are checking for necessary ports.
This means that it is checking port 80 and I think mysql....
However, as long as you have no errors here, then you are absolutely fine.
You can see you're being set up with Apache 2.2 here.
And it looks as if the service is starting and also the mysql service is starting.
And we get a message... saying that our installation is finished.
Now we can start the XAMP control panel. You click "Yes" and we can bring that over here.
You can see that we've got our Apache server running and our Mysql server running.
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.
So, lets go and load our page back over here.
And you can see that by pressing Enter on "localhost" again, we've connected to "XAMPP", as you'll expect.
We can have a look inside a particular directory in our webserver as we usually would.
For now just go ahead and click English.
And you can see that you have "XAMPP" set-up here.
Ok, now I'm going to open my "C" drive here and you can see it inside here.
And I'll click on "XAMPP" which is the installation directory we have installed.
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.
So if you double-click on this, you can see that we've got a variety of files here.
And this "index.html" is the file that you can see here. This is "index.php" for now, which is here.
And index dot anything in this file that's automatically started up.
You can change this but just leave it as that for now.
And.... I've got a folder here called "phpacademy".
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.
Lets get rid of this. Okay so I'll create a new file.
I'll save that and that's saved to.... my "htdocs" folder here and I'll just save it as "phpinfo" and dot php.
And inside here I'll type some php code.
And this will be "php underscore info" and you need 2 brackets then you need a line terminator.
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.
This is just giving us some information of our PHP server or our webserver php installation.
So we can come back to this and here we'll just address this, so you need "localhost".
And you don't need to type "htdocs" or anything like that.
All we need is "localhost" and we need to type in.... lets see....... what do we call our file - "phpinfo dot php". Press Enter.
We don't need the underscore. So take away that and you need to refresh.
You can see that we've got our php information file here with lots of data.
So what is happening here is we are running a php script inside our htdocs file.
So if I were to say address "favicon dot ico", you can see that we are getting that.
Any files that you put inside "htdocs" are processed by your webserver through php.
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.
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 webserver.
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.
We've downloaded and installed "XAMPP" and I've shown you how to create a file and run this through your webserver.
So hopefully this will be of use for you to start with the tutorials. If you have any problems feel free to contact me.
Please subscribe and I'll see you in the tutorials to come. Thanks for watching!
This is Joshua Mathew dubbing for the Spoken Tutorial project. (Script contributed by Bhavini Pant and Nancy Varkey).