Install & Set Up PHP on Apache Windows 10

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this video i'm going to show you how to set up php on a windows apache server this will be the follow-up to my previous video that showed how to set up a apache web server in windows 10. so the first thing you're going to want to do is pull up a web browser and go to the php website and once you're on the php website there will be a downloads page so you're going to want to go to the windows download section and feel free to just get the newest current stable version of php that's fine should be fine for most purposes go to windows downloads and you're going to want to get this thread safe one make sure you get the thread safe one because it has what apache needs this one doesn't have those files by default so go ahead and click this one and go ahead and download it once the download is complete go ahead and click on it to pull up the unzip program this is just windows default unzip program yours might look a little different if you use like winrar or something like that so you're gonna click extract all and then browse and you're going to need to create a new directory in your c drive or wherever apache resides so if you followed the previous tutorial apache is in my c drive just sitting here so i'm going to make a new folder right here called php and this way i can go into php folder and then i can select it and unzip all of these files and that way it won't clutter up your c drive which i would definitely suggest doing um so once it unzips it'll be in here like this and we're gonna need to tell apache how to look for php so to do that just go into your apache folder and go into the comp folder which is configuration and edit your http httpd.com file so you can just do open with notepad if you just have like everything default on windows and uh you can see it and i've actually already changed this so what i did is i pasted these lines in right here and i will post these lines into the comments so you can just copy paste them right in uh basically before i pasted it the file looked like this just nothing at the top um having to do with php it's very strange to me that apache doesn't come with some kind of template for pointing to php but um if you didn't have this code right here you could just google it and somebody would have this basically what you're doing is you're telling it what modules to load and where to find the php files in the directory so all that really needs to change if you have a different uh location of your php folder just change these directories it'll work just fine in our case this is already set up to match uh the environment of our previous tutorial so i'm just pointing it to the c php folder and then you got these apache dlls and php 7dlls anyway go ahead and save that and close out of it and that has pointed apache to php um what you're going to want to do now is since we made a change to this file we're going to have to go to services and we're going to go to where apache is running which right here is apache 2 4. go ahead and either if it's not started click start or if it is started go ahead and click restart and restart apache or start it up okay now that should be running uh just go ahead and do a little quick sanity check and go to your web browser and make sure it's still working if not at this point if you're so early in the tutorial that this isn't working feel free to just go back to a few more steps or start the whole thing over um typical things that could go wrong is if you just had a little typo in there um you don't want any of these to be commented out with a hashtag it should look just like this so now that we see that that's working we're going to go into our directory where we see this file this is the apache htdocs directory and in here is the file from our previous tutorial where it says it works and we're going to put a new file in here just to check and see if php is working so go ahead and do new text document and create a file called piinfo.php one thing that's going to be a little bit strange to new developers is this is not actually a php file yet you see that's a text document so if it's doing that to you this just a quick little detour bear with me this is necessary go into file explorer options and go into view and uncheck uncheck hide extensions for known file types so the way i got to that is you just go here type in folder it'll pull this up and then on this pane you go to view and just uncheck unknown or hide extensions for known file types so when you apply that it's going to stop hiding that extension so go ahead and make sure that this is just p info.php and it'll ask you if it's okay to change this file type click yes okay now you have a blank php file um go ahead and open it with notepad to edit it and paste in there i'll put this in the comments as well these php tags so it's a php open tag php close tag and then php info you don't have to worry about the coding aspect of this per se right now but basically this is going to show us if php is working or not so if we go to slash p info.php it should pull up this page and this is how you know for sure that apache is working with php right now so you can see um that it says apache is running the php version 7.4 uh there's probably something about apache in here yeah you can see it it understands that this is apache 24 with php 74. so now our php environment is set up properly in apache and if we were to go write a more advanced script inside of a php file you would be able to properly have the php code executed on the server side i hope this video helped you and i plan to make a bunch more like it so if you guys could like the video so other people can find it and i also do appreciate the likes and the feedback it helps push my videos and tutorials up higher on the youtube search so if it helped you uh please like and subscribe and thanks for watching i really hope this helped you guys
Info
Channel: Flavor Of The Month
Views: 5,071
Rating: undefined out of 5
Keywords:
Id: VwObm3qvS3Q
Channel Id: undefined
Length: 7min 17sec (437 seconds)
Published: Wed Nov 04 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.