PHP in VSCode using XAMPP

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone chris erno here i want to real quick go over a better way to set up uh and get php and apache and other things running on your computer for web development i know the other video i had a real quick plug-in for um visual vs code but i wanted to show you a better way to do this um so first you're going to want to get x-amp and you download there's other versions too so if you need a specific version for like whatever php you run you can click here and you can get older versions but i went ahead for this example i went ahead and downloaded xampp for windows the 8.03 so here over click all uh [Music] and we'll go ahead and run it [Music] oops nope wrong one wrong one is it running yeah okay so the reason why you want to use this is so um uh you can test how the server is gonna run um before like uploading it so that you know that your code is gonna work with the server settings and the virus running something is gonna sit on yeah i don't care it's fine any systems some functions of please avoid to install to missing right rdx value right okay yeah sorry um i forgot about that but anyway so i do the setup and you can put all the stuff on here if you want but i don't need the filezilla i don't need tomcat i don't need the webalizer if you do want those you can do them but um i don't really need them so i'm just going to leave it like that and help me purl and i think that's it right fake sydney all right so i got those just like that and we're going to install it to the c drive on the default folder no i don't care right now so we'll go ahead and install it and yeah uh no i do not i don't know okay so i'm not going to start it right now because i want to show you something important so when you have it installed i'm going to close that i don't need that you have installed um in order to run or turn on and off the um to run apache and my sequel you have to run it as a administrator so you can right click and run as administrator here or you could do like what i'm i'm going to show you and for me let me pin this to start i just let's see xampp yes all right now where to go example no i want you over here in the coding area and then i'm going to want pen to start because you're going to be going to that folder a ton let me tell you okay so instead of having to right click every time and go to run as administrator you can just real quick trick go to open file location then right click on it go to properties and i think it's advanced yes you click on okay let me do that again you come over to advanced click on it and then click run as administrator and doing this it'll make it so every time you open the uh click apply yes yes okay now every time you go when you click on it then start it from your start menu or wherever you want to run it from um it'll automatically start in uh administrator mode or with p pro with privileges my bad i can't talk today [Music] so anyway let's go ahead and start that bad boy up and then now the configuration port is free you need to install unlocking applications right okay in order to get apache to work or php in general to work is what you're gonna you're gonna have to change the ports right so okay so this is what it's gonna look like when it starts and so um what i did is i just added 80 in that so it's 8080 is the main port and then i changed it to 4443 as the ssl port so you're going to click save click save we're not done yet though we've got to go into config click config under apache and then go for the first one the httpd.config so what you're going to do is once you're in here you're going to go and look up listen so the the fastest way is to hit ctrl f to find and you're going to type in listen hit enter a couple times and when you get down here you're going to see it says listen 80. so we're going to do is type in 80 so we have 8080 which is what we had set with this config and you're going to go to f server name and when you get here you got localhost and you'll add 80 at the end so you'll have server name localhost 8080. just to recap and we set listen to 8080. nope oh go up down below we set listen to 8080 and then we watched it down and we said whoa whoa whoa whoa i passed that there buddy no server name i'm sorry i'm sorry getting ahead of myself down and we set this to 80 80. so once you're done with those two you save it and close that and now you go in here to config in the httpd ssl.config and the last thing we'll have to do is go to listen [Music] and we're going to change that from 443 to 4443 and then we're going to go to type invert virtual host and then see it says virtual host default we're going to do the same thing and just add another four and then once we're done there you hit save close that and now just real quick recap we set this to 8080 4443 and then we went to the config and set the listen to 8080 the server name localhost 8080 and then with the ssl we did listen 4443 and the virtual host default 443 or 4448 site now that that's done hopefully this will start and what do you know it's running and we can start sql as well if we want and so let's uh let's let's go to local and see what comes up hey look it works it works nah so what you're gonna you're gonna be doing a lot of along with this is going to the htdocs folder let me um let me show you so i have this on my start menu as well uh because whenever you um see like we're looking at this right now this is this whenever you make a project you're going to put it in here so let's just just for the heck of it we're going to put a new folder we're going to call it hello world go in here i'm going to go new file let's go text document and we'll call it index oh okay let's go php yes so oh i'm not going to open it with that that's just you don't need that let's go notepad i'm gonna go [Music] hello world and so what we'll do is we'll go right here hey look at that it works so whenever you're working on your projects you just drop them in here right and so then you can go to the web page here so that's why i do highly recommend having a shortcut to this folder because you're going to go there a lot when you use this with vs code it's real simple right so you're going to go and open the folder the htdocs so we're going to go open folder i hate that it's downloaded i'm going to go to xampp htdocs i'm gonna go to hello world folder again so when that loads in you'll see that it says hello world so um so i got the apache thing going so we're gonna or yeah server going so we're gonna go and go local post hello world right so if we make any changes here we'll just do that and we'll say how are you save that control s and then you can just hit f5 or control f5 and there you go may add the changes it's real simple i just wanted to make sure it was clear on how to use this so anytime you make changes you just hit ctrl s and then refresh the page and you're good and you just got to make sure it's at local hosts uh an 8080 or whatever port you use and then make sure in that folder and it'll automatically bring up the index.html or php whatever and that's it you're good to go and other than that it's pretty simple i mean it took a second to get stuff set up but once you're set up here you're done you're good so i hope that was helpful in some way and good luck
Info
Channel: Chriserino Coding
Views: 19,658
Rating: undefined out of 5
Keywords: php, vscode, xampp, chriserino
Id: NG1SJGYYbTk
Channel Id: undefined
Length: 11min 33sec (693 seconds)
Published: Wed Apr 21 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.