How to debug PHP in Visual Studio Code (Simple steps)

แชร์
ฝัง
  • เผยแพร่เมื่อ 14 ต.ค. 2024
  • I set up my debugger today and created this quick video to help you in case you want to debug PHP in Visual Studio Code.
    Settings to enter in PHP.ini (from the video)
    zend_extension = xdebug
    [XDebug]
    xdebug.mode = debug
    xdebug.start_with_request = yes

ความคิดเห็น • 49

  • @DemsRNutless
    @DemsRNutless 6 หลายเดือนก่อน

    There are many "how to" xdebug setup videos for PHP in VS Code. None of them explained this at all. This is the only video that actually worked. Who knew the settings.json line items had to be manually inserted? Nobody has explained this before. Now I can accelerate my work to a much greater degree. I am very grateful my friend.

  • @PaulCashmore-i5l
    @PaulCashmore-i5l 17 วันที่ผ่านมา

    Very clear - worked first time! Much easier than a lot of the other misleading guides.

  • @digital_sorceress
    @digital_sorceress 9 หลายเดือนก่อน +16

    On a new VSCode install the debug options for running in browser are not there - it seems some step was missed - you must have some other extension installed or configuration you did not go over.
    Also telling people to use search for the settings.json only works if you've ever opened it before
    settings.json is stored in c:\users\YOUR_USERNAME\AppData\Roaming\Code\User\settings.json
    but would be easier to find if you told folks to go to the PHP Debug addon then click on the settings icon then select extension settings then click the "edit in settings.json" to find it
    The video was fairly helpful but it's assuming a lot - probably because you already have things installed and configured that you take for granted.

    • @digital_sorceress
      @digital_sorceress 9 หลายเดือนก่อน +1

      OK so missing critical info - I was just testing by making a random php file with some code in it - in that case the run just runs /debugs to console
      however, I tried pointing vscode to open a directory where apache was serving from c:\xampp\htdocs and then had debug and run create a launch.json for it - THEN I was able to get the run options mentioned.
      Over all the video was helpful, and saved me a lot of steps but there are quite a few assumptions

    • @shaikmasthan5271
      @shaikmasthan5271 หลายเดือนก่อน

      @@digital_sorceress Thank you.

    • @kalanyosdartveder5357
      @kalanyosdartveder5357 15 วันที่ผ่านมา

      @@digital_sorceress Thank you! It is a right comment at right place. I stuck into the same problem and your comment helped me finally solve it.

  • @NedumEze
    @NedumEze ปีที่แล้ว +1

    Thanks, Jeet.
    You seem to have made light of the reality that many cannot do the "step through" the code! You focused on set-up which is very helpful. But what use is set-up when I can't use it!

    • @digital_sorceress
      @digital_sorceress 9 หลายเดือนก่อน +1

      When you have the php file open you can click off just to the left of a line number to set a breakpoint ... the breakpoints checkboxes in the run debug should be checked for the php file and then when you run it should stop at the point you set.. you should then be able to use f10 to step over f11 to step in f5 to continue etc..

  • @cyex4311
    @cyex4311 8 หลายเดือนก่อน +1

    Thank you for the concise and easy to follow video. Teaching me more than my course!

  • @ludkavretenarova4825
    @ludkavretenarova4825 หลายเดือนก่อน

    It was a bit difficult to find settings.json, the way you show it in video didnt work for me but then somehow accidently I found it and it works, thank you so much for your tutorial !

  • @HaslamIT
    @HaslamIT 3 หลายเดือนก่อน +1

    Thanks Jeet.
    A useful and informative video but I am having some problems.
    I have installed XAMP and Xdebugger and it seems to work for debugging current open script and I can step through code etc.
    However, the option for "Listening for Xdebug" does not seem to be working and the debugger does not start when I load the local Web page on APache?
    Can you offer any further help is to what may be wrong?

    • @kalanyosdartveder5357
      @kalanyosdartveder5357 15 วันที่ผ่านมา

      Please check very first comment made by @digital_sorceress. There is the answer to your question.

  • @juhelius1234
    @juhelius1234 5 หลายเดือนก่อน

    Thank you for the straightforward tutorial, worked like a charm!

  • @quochuynguyen7236
    @quochuynguyen7236 11 หลายเดือนก่อน

    Thank you so much. Very helpful for me. Don't meet any problem while installing. Just following your video step by step. Great

  • @jesusalbertocervantes8558
    @jesusalbertocervantes8558 ปีที่แล้ว

    hi, nice video, i had one question, do you had to use composer to create that app ?? i tryiet this on my own proyect but i failed hehe, thanks

  • @cbbcbb6803
    @cbbcbb6803 ปีที่แล้ว +1

    Thanks. I would also like to see a set-up of this on Linux.

  • @NATANpoa
    @NATANpoa 5 หลายเดือนก่อน

    Você é o cara. Me salvou. Obrigado.

  • @FacedGod-j1m
    @FacedGod-j1m 7 หลายเดือนก่อน

    Hey Jeet, I followed the steps but the debugger is not getting hit can you help me with the configuration of 'launch.json' too?

  • @sadface
    @sadface หลายเดือนก่อน

    This doesn't seem to work - I still just get the "Welcome to XAMPP for Windows" /dashboard/ page...

  • @Bondjara
    @Bondjara 9 หลายเดือนก่อน

    This helped me a lot! Thank you!

  • @asherheed
    @asherheed 11 หลายเดือนก่อน

    thanks bro this was very clear. helped me a lot

  • @chriswha735
    @chriswha735 10 หลายเดือนก่อน

    you save me a lot of time, thank you, very clear

  • @SathyamoorthiP
    @SathyamoorthiP 4 หลายเดือนก่อน

    Thanks. This is really helpful.

  • @tmis0806
    @tmis0806 9 หลายเดือนก่อน

    Simply and easy! Thanks

  • @tripmad
    @tripmad ปีที่แล้ว

    Happy to see your new video!

  • @nilscarrillo4247
    @nilscarrillo4247 ปีที่แล้ว

    thanks for your video it was so helpful for me!

  • @abdoul1562
    @abdoul1562 3 หลายเดือนก่อน

    Thanks you man you are very helpfull

  • @casasniper
    @casasniper 9 หลายเดือนก่อน +1

    its not working , it asking me create launch.json file

  • @maurofabian4061
    @maurofabian4061 7 หลายเดือนก่อน

    thx man, you are amazing :)

  • @sbastion8446
    @sbastion8446 ปีที่แล้ว

    Thanks a bunch for the help! The debug works now 👍

  • @frankpulido873
    @frankpulido873 หลายเดือนก่อน

    Anyone knows about a good tutorial for installing Xdebug in MacOS, PHP 8.1

  • @yashwantpanday3351
    @yashwantpanday3351 4 หลายเดือนก่อน

    am not getting setting.json file
    please help me

  • @strikerwow2011
    @strikerwow2011 ปีที่แล้ว

    Amazing video, thanks!

  • @douradavidboge6804
    @douradavidboge6804 ปีที่แล้ว +3

    Cant find settings.json

    • @adambhatti9001
      @adambhatti9001 ปีที่แล้ว

      @@thecodeiseverything can you explain it

    • @deepub3295
      @deepub3295 11 หลายเดือนก่อน +2

      c:users\xxxx\AppData\Roaming\code\users\settings.json that folder may be hidden

  • @jansenk31
    @jansenk31 ปีที่แล้ว

    Thank you, very usefull!

  • @dev.antunes
    @dev.antunes 6 หลายเดือนก่อน

    Thanks a bunch!

  • @KennethRJones-SWEN
    @KennethRJones-SWEN 5 หลายเดือนก่อน

    THANK GOD

  • @sankiGunda.
    @sankiGunda. 10 หลายเดือนก่อน

    thankyou sir g

  • @vanchien5874
    @vanchien5874 7 หลายเดือนก่อน

    Thanks.

  • @saharaprotocol
    @saharaprotocol 8 หลายเดือนก่อน

    thx bro

  • @md.shaheenalamjony4945
    @md.shaheenalamjony4945 ปีที่แล้ว

    Thanks

  • @henrywans8333
    @henrywans8333 5 หลายเดือนก่อน

    did not worked at all

  • @blaircooper9956
    @blaircooper9956 7 หลายเดือนก่อน +1

    X Debug tried. OMG must have been designed to debug this sole code. It's a joke. Please dont publish useless info

  • @Sandipansarkar16
    @Sandipansarkar16 5 หลายเดือนก่อน

    you are not my best friend stop saying that it is so weird to hear🙄

  • @starexrex
    @starexrex 8 หลายเดือนก่อน

    you using xampp so you wrong

  • @Honn3ts
    @Honn3ts 2 หลายเดือนก่อน

    i don't have settings.json