How to Install PHP 7 on Windows

what's going on guys it's clever techie in this video we're going to learn how to install the latest version of PHP seven and making work with the latest version of apache two points for 16 on Windows 7 operating system alright first thing you gotta dude open up a browser go to Windows Windows php.net /q a and here you find that PhD in 7 beta version we're going to scroll down from here and you're definitely going to want to thread safe version because that's the only version that will work with apache and it's got the required dll libraries included with it we're also going to get VC 14 since that that's the latest version of apache that was compiled in DC 14 and i'm going to get the 64-bit version but if you have a 32-bit can I want to get the x86 that's a VC 14 anyway let's download it and i'm not going to say that already have it downloaded by you guys can click OK here and just wait for the download it takes about 25 minutes alright so i'm going to open up my downloads folder was tennis downloading you're going to end up with oil here and i'm using winrar which I talked about in the Apache video and you can get it at Ross off . com that's what I used to extract the zip files so I'm just going to right click on this file here extract files and i'm going to extract it to the c drive directly in the PHP directly see / h beam and it's just going to extract all that ok next let's just check it out and see that we have a new chain holder here and you're going to end up with these two PHP ini files in your directory where you extracted phb already have my PhD that 1i but you guys can go ahead and rename this HD development just delete this part just simply delete it and press ENTER and it's gonna change into just php.ini php.ini is what you want to end up with and before you do that make sure your you go to get your extensions are not disabled from the view so you can check that by going to organize folder and search options you and then just make sure that this check box is not checked so you don't want to hide extensions for known file types and press apply so then you're going to be able to change the extension of this son of this file here alright so now we need to configure apache to work with our PHP because the two don't know about each other just yet so let's go to our fhe folder and line is on the C Drive actually 24 folder I'm going to go to my conf folder and open up the HDPE not con file which is the Apache configuration file to open it and going to see a bunch of texts we have that you can configuration text and here is all the texts that you need to add in order for apache to work with PHP let me just explain briefly what all this means so this first line at handler here just tells Apache to parse PHP files so it knows to interpret the PHP code the ad type you're adding an HTML and XHTML capability of five interpreting the PHP code inside those HTML and HTM documents so basically you can create an HTML page and you can insert some PHP cold live in it and then it that she's going to interpret that PHP code without this line the PHP code within an HTML file is not going to work so i recommend that you add this line and then the last one is the load module which actually loves the Apache module and just copy the hotline and make sure that you put your PHP directory where your PHP files are located mine is so PHP and I have that file in there and you should too and if you haven't if you downloaded there and you're installing an earlier version of PHP then make sure to change this value 25 and this value 25 but I we're installing the hd7 and we're going to look like that and here let me just show you where that file is see each meet and there it is that is ideal file file that will be loading from the attachment configuration and the last one is the php.ini directory and this is where your PhD the binary file and we have renamed earlier on and this is also in the scene that CPS being direct a fear my C Drive PHP PHP . i 9 this is what you're telling where that file is located by this line so just go ahead and add all these lines and then scroll down here and just make sure that you know where your web files are going to go because we're going to need to access that director in a bit so minus C local holes and put all my PHP and HTML files they'll be running using apache later on ok that's what we need to do here make sure you save the document close that close that as well now what's here okay well I'll pretty much ready to go let's go around patchy folder go back here and then open the bin folder and then you can just open up the matching honor and double-clicking on it remove this year you guys can see and now we have the matching monitor right here and one out my Apache is already whining and just going to be started to make sure successfully loaded and looks like it is so if you're a patch is not running you can just open the matching minor stop it here this means that patch is not running so you want to start it and then boom that matches services started can close a minor no now i'm not a way will to load the passion without a monitor would be to just access and those services so just go here in the start main and type sir mrs. and services going to show up hold on that one that's gonna pop out with a bunch of services and apache should be right here and you can also start start stop and restart apache from the services and window so that's not a way of restarting apache and every time you guys are going to be modifying your Apache configuration file or your PhD the iron I remember that Apache will need to be restarted every time you do that so your settings to take effect and we're actually going to test that out a little bit here ok now that my match is running i can close this so we're pretty much ready to test if PHP is working with apache right now so here's how we're gonna do it I'm gonna go back to my web files folder which is located on see local Hills tray and your guys holder my D different depending where you set your document bluetooth and I talked about and i have miami for my web files in here you just delete this file now and this is the root directory where we're a patch is going to be loading from so let's create a file to test if PHP is indeed working in Apache you get i'm going to call the way here in this corner current has been seen yet anyway here's that hears that folder in Slocumb most sorry na got to drag this back up here alright so what we're going to do here is create first of all navigate to your web what files folder where all your files are going to be loaded from apache and now we're going just I'm going to right-click all the way here out of you and then i'm going to select the text document right at the bottom you guys can see but you have that text document and this case in txt file and I'm going to name this file the intro dot PHP and i'm going to click yes now again make sure that your folder and your view options the hide and extensions for known file dices unselected that way you're going to be able to create different files loop an extension like the HP anyway let's go ahead and open the file with a notepad and then type the following PHP code now these a this is an opening tag for PHP and this is a closing tag which tells the browser will we are coding in PHP and then we're going to insert this very simple function here called PHP info and we're going to save this file so this is just a function that tells us what kind of a PHP version we're running and apache and all those other configurations so i'm going to save file and exit and now we're ready to test PHP and apache together or patches ryan and everything is configured so we're going to open up the browser and type localhost and have caused this file shows up because that's the index HTML HTML has been pulled I'm going to go photo / info . h which is the file in the root directory that we create press ENTER and voila he got our PHP or cane and tells you which version you're running and then a bunch of other configuration settings that you can look over but this is a this definitely tells us that PHP and apache are working now before I let you guys go let's just do one more thing we're going to modify our PHP dot ini file so i'm going to go back here and my C Drive access the phd folder and then i'm going to open up the speech the configuration file with a notepad and then I want to enable one of the extensions and first of all we need to uncomment the we need to enable loading of the extensions from the directory so we're going to go to end it find and just type txt double quote my next is going to find the extension underscored air the semicolon here Estelle's PHP that to ignore this line so we want to uncomment it so that PHP can start reading this line and our extensions are located in the EXT directory by default and we don't need to specify the all the full path PHP array nose is an apology from your directory and PhD folder so we commented this line now PhD knows where to load the extensions from and i'm going to go to edit find again and i'm going to type curl which is a very common extension know you probably going to be using uncomment this line as well and now the PHP is supposed to load curl library from the extension folder and so this is just a test out and see that our PhD ionized working and so let's go ahead and file save close out the php.ini and now we're going to go back to the browser and we're gonna get type localhost again browser and go to our infidelity HP file and then we're going to hit ctrl f the search and i'm going to search for curl now this doesn't mean anything here it doesn't mean the curls loan it's just some information about girl but if i press fine again and oh ok sorry i forgot to restart apache yeah okay let's go ahead and I'm going to go mice my bachelor's degree and I'm gonna left click on it go here we start so that was a perfect example actually I'm glad I did that made that mistake because you guys can see that the settings didn't take effect unless you start apache so now that the benches we started going to go back here to our settings I'm just gonna refresh this page fresh pictures your first ctrl-f search for curl again and bam there it is now the PHP that I know settings have worked its loading curl it's pulling it from the extension directory and it's loading the cart extension so we know that we now know how to modify our PHP that a knife file and whatever settings that you guys need you can always modify HP that I and you can also create a shortcut somewhere where it's easily accessible i personally have my configuration files in this menu year settings there's the Apache configuration file and there's the PHP PHP dot ini 2nd easily and quickly access them and of course of course don't forget to restart apache every time you modify PHP dot ini otherwise this this changes are going to work so that was it you guys now have the latest version of apache and PHP seven running on your computer in the next video I'll show you guys how to install MySQL so you can start working with databases and i'll see you guys in the next video