PHP Front To Back
Lesson 2 of 22 · PHP Front To Back [Part 2] – PHP7 & Xammp Installation · IT & Software
PHP Front To Back [Part 2] – PHP7 & Xammp Installation
hey guys welcome to part two of PHP front-to-back in this video I'm going to show you how to get PHP set up along with Apache and
MySQL now we're going to be using a software suite called xampp or sometimes pronounced zamp and it comes with all of that stuff and you'll see it says maria DB and not mysql it's basically a
drop-in for mysql it has all the same functionality plus some extra stuff so it's the same exact thing for what we need it for now xampp is cross-platform so you can install it on Windows Linux
Mac if you are on Linux though it probably suggests that you just go with the lamps vacuum that you install PHP Apache and MySQL separately and probably PHP myadmin as well which is also
included in xampp because it gives you a more realistic server environment alright but if you're on Windows or Mac I would suggest xampp there's also lamp for Windows and then there's also MAMP
for Mac which are basically the same thing they all give us those three things Apache PHP in MySQL so you want to go to Apache friends org and you can click one of these buttons if you want
to install PHP version 5.6 at this time but I want to use the latest version which is 7.1 so I'm going to click on this green button here ok and then if you look over here it shows you the
different versions this is all for Windows this is 1x this is Mac so we want 7.1.1 so I'm going to click download and save that okay and that's 120 megabytes so it
might take a minute or two alright so that's all set let's go ahead and open that up now if you get this message it's just telling you that if you have user
account control enabled it might give you some issues but I've actually never had an issue with it so I will just click OK okay and then we're going to just get an installer window like this
we're just going to click Next and then here you can pick and choose what you want from this software suite we have Apache MySQL FileZilla which is an FTP server I don't want that I don't want
the mercury mail server or Tomcat ok I do want PHP and I'm going to keep Perl as well and then down here with PHP myadmin which is used to basically interact with your with your MySQL
database in in a graphical format ok webalizer which have to do with statistics and then sake send mail so I'm just going to keep all those enabled ok it's going to by default if you're on
Windows it's going to install it in the C Drive I'm just fine I'm going to uncheck this bit Namie thing and now it's going to install all right guys that took about a minute or so
now it's going to say do you want to start the control panel now I'm going to uncheck that and I'll show you why in a second so let's click finish and now it should be installed so if we go to C
I'll go to my C Drive and you should now have an X amp folder and if we go down here you'll see there's this xampp control D X eval the reason that I didn't start it after the installation
is because I want to right click and run as administrator ok you want to make sure that you do that ok all right so let's go ahead and just stick all right so now you're going to get a
window like this now the reason that I had to run it as administrators because I want Apache and MySQL to run into service she's been meaning I wanted to run in
the background and I wanted to run automatically so to do that you just need to click this red X and click yes and then this one and yes and if we didn't run this as administrator we
wouldn't be able to do that this would be grayed out okay so that's why I need to do that and then we can start up Apache and we can start up MySQL okay so those two things are now running as a
service in the background on our system okay PHP as well so now let's open up a browser window and I'm going to go to http localhost okay so when you do that you should see a screen like this this
is just the xampp welcome page notice that when we went to localhost we got redirected to slash dashboard okay they actually set it up so that it does that now when you're working with your server
the folder that you want to work in is in the xampp folder right and then you're going to go to htdocs and this is basically the root of your web server okay it's loading this index.php file
just like when you work with HTML you need an index.html for it to be basically the root same with PHP name at index.php and it will load automatically all right now if we look at this real
quick okay basically you can see that this code here I'm not going to explain all of it but it's redirecting us to slash dashboard which is the page we just saw okay if you want you can just
get rid of all this keep the PHP tag and then we'll just go ahead and echo it works okay because there's not much to that dashboard it's basically just informational so if we save that now and
we try to go to localhost we just get it works okay it's just loading this index.php file now we can go ahead and start writing PHP now you're all set up but one thing I want
to do is I want to go to PHP myadmin which will be at localhost / PHP myadmin okay from here you can manage databases if we click on the database tab and see there's some sample ones here but what I
want to do is I want to add a password because you saw we could just come right to this without entering a password and if we built the script where we were using MySQL we could connect without a
password and we don't want that we want to be more secure so we're going to go to user accounts and you want the root user and the hosting local localhost you can see right here it says no for
password we're going to click Edit privileges and we're going to click right here change password let's go ahead and add a password here okay and then we'll click go and if we try to go
back to databases we're going to get a whole bunch of errors here okay basically access is being denied because we never enter that password so now what we want to do is edit a config file and
just add that password in it so if we go to xampp and then PHP myadmin and then we want to go to this config Inc PHP file I'm just going to open that with sublime text and we're going to go to
this line right here this password and put in that password that you used okay and then we'll just save that go back here reload and now it's all set okay so now we're using the password in this
config file and then when we use MySQL and our script we'll have to add that password alright so you now have PHP and Apache and MySQL setup on your system so now in the next video we can start to
write some PHP code
In this video we will be installing Xammp which includes PHP 7, Apache and MySQL. This is in preparation for a big series on PHP