Enable Xdebug in MS Visual Studio Code using WAMP server

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi guys this is just a quick tutorial on how to integrate our enable X debug for PHP in Visual Studio code using WAMP server so first first of all the most important thing is that you have vamping already installed so we have the latest version with PHP 7.3 you can see here the my version already concept with X debug installed in order for you to first check whether to whether the XT package is available you need to of course enable them first so the server must be running then just go to localhost and PHP my admin' oh no sorry please pick info like PHP as you can see here there there is these are the details about your PHP installation you can search for the XT bug and you can see here that I have version 2.7 point 2 installed already and if you see again on the bottom you can see all the settings for X the bug here so if if you don't have that so you will need to just search on Google download X the book I'll also link this and also add this in the description below my recommendation is to use not a better version but not an alpha version but a stable version so two point seven point two this is the same one I have choose the one you need for your version of PHP most likely it would be a 64 bit version you download it and if you download you go to your to ramp installation usually it's in C / ramp then you go to the bin folder PHP the version of the PHP running PHP 7.3 and then send extensions if for some reason you don't have this folder you need to create it to sent underscore ext and then down the DLL so this is the downloaded file from here you just place it here next you after you install the after you do this try to restart the web server and add this to your PHP ini file so this is the this is this is what I'll always add in the description below and this is the settings so first designed extension it should link to your to your file you just downloaded so in my in my case is web in PHP PHP seven point three point seven cent ext PHP expert at Sarah's DLL if you already have some of this then you I in my case I just needed to add both of these fields so removed enable one and remote auto start one so those were the things I needed to add after you do that you can close the PHP ini file and restart the web server next you need to just check I think that also you need to check in the PHP extensions that this should appear this should appear here under the Zend extensions and you should make it to be enabled so this checkmark means that it's enabled after that I think that you will need to make another restart and it will and it will way we will also restart automatically you'll see no if I click here you see it's it's restarting it's doing something so we'll wait a bit so in my case I'm disabling it now and if we check again let's say now it's disabled well when I run it again it will restart and enable it so that's the that's the thing to enable the extra back now if you want and now let's use that in our Microsoft Visual Studio code in my case I will create a new project I will just make so I'll I will just point to this directory so I can also do it from here lamp www - the back I already have a folder for this but I will I will create one more test it will be called XD puck so I'll create a I'll create an index file and extract HP file and now I will just open open this folder test text book select and now I have this file I would just add some code like like a loop just to just to make sure this works it just looked true ten times and I will just do I don't know very relaxed because I just it doesn't matter what it is you just just add to it and make it a default to one now you need to you see I have an extension here called debug so you need to install that first we will go under extensions and write x debug and install PHP debug extension you see I already have it installed when Iced when you install it you need to reload the visual studio code and our just restarted and then you will see this icon here like a bug icon and now it should be able to it should be you should be able to make it to make it work so in order to for you to do that you need to add a configuration file choose PHP and it will automatically create this launch that JSON file here you will see that it's also available here in your project I'm not changing anything here I don't think you need to change anything maybe if it doesn't work for you and on this port you would you would need to add to change the port in my case I've used it to use it a few times it worked just fine on the port 9000 so now I would just add a breakpoint here and click start debugging now the X debug is running and now I just need to actually start this project in my browser in order for the debugging to begin so because my project is in the test the underscore X debug the location would be local hosts tests underscore X key bug enter and now you see this shows up that I have something running here as you can see I can click the debug icon again as you can see the execution of the codes stops on my breakpoint and I can start the body you can see X 0 we're on this position now I is an initialized if I go step over see now I is initialized usually one word now X will get a net and you well you can see X is not 1 I was eyes I know it wrist is incremented and that's about it I hope this helps if you have any problems I would strongly suggest for you to comment down in the comment sections and see you again bye
Info
Channel: Kanga
Views: 10,517
Rating: undefined out of 5
Keywords: php, ms, visual studio code, vsc, wamp, xdebug, debugging, debug, extension, plugin, programming, code, script
Id: 47kbG7W_UtY
Channel Id: undefined
Length: 10min 7sec (607 seconds)
Published: Mon Aug 19 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.