Debugging PHP7.4 with XDebug 2 and VsCode

preview_player
Показать описание

Debugging is really important in any language. VSCode is an excellent editor.
I decided to see how debugging works in VSCode on PHP language. And it turns out to be very good.

In this video I will install XDebug extension in Xampp installation, enable debugging using VSCode and debug PHP applications.
VScode supports debugging of both types of applications. Using browser and using terminal.
We will see debugging steps. We will get familiar with debugging interface of VSCode.

Then we will debug Youtube Clone application written in Yii2 Framework.

Checkout my other videos:

If you really love my content and want to support the channel:
👉 My Patreon: (For monthly donation)
🍺 Buy me Beer: (For one time donation)

Check my Github:

🖱️Follow me on social media:🖱️
Рекомендации по теме
Комментарии
Автор

Thank you. The breakpoint just don't stop. The extension help says should put these lines in php.ini if the DLL file version is 3.x.x.
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_port = 9000

hope works for you guys.

智慧蛇
Автор

i am doing php development from last 5 years.. and i always use echo to check output of each line ...now man.. u made life easy for php devs.. thankss .

bilalshahzad
Автор

oh man, so many years just finding the best way of logging data to get errors... and it turns out using the debugger was so much simpler. Thanks for the video!

AlanGCarvajal
Автор

Bravo. Even though I know how to set this up, I watched your video because my method and explanation would be long, drawn out and boring. But yours is concise, easy and even entertaining. So a big thank you! And a big thumbs up!!

sosurim
Автор

0:48 intro ends
1:10 Installation step by step (phpinfo, download)
1:56 folders and files modifications for installing
3:16 config ide
3:45 first demonstration (breakpoint)
4:37 listen for xdebug

davidramos
Автор

Hey, I just wanted to add, that because of this configuration it did not work, but I didn't find any hint on the whole web, that this should be set. Actually only by looking into the documantation on xdebug-platform, I found how to get it work. This ist what is to be set in php.ini:

xdebug.remote_enable=1
xdebug.remote_autostart=1
xdebug.mode=debug
xdebug.remote_port=9003
xdebug.start_with_request=yes
And when configuring the launch.json in VSC, port should be adjusted to 9003 (instead of 9000, for the right port, look in phpinfo()).
SW-Stack:
Windows 10 x64 20H2
VSC: 1.51.1
XAMPP: 8.0.0
XDebug:

turtle_titan
Автор

Wonder-full waited for this for a long time after shifting from C# to PHP

fahad
Автор

You really understand better what developer needs, you saved my time with this tool. thanks again.

kiranugale
Автор

Thank you so much. Somehow I had an old launch.json in there. I kept installing and reinstalling phpdebug but not doing the the Run > Add Configuration step. Nice to be able to debug within VSCode!

workingTchr
Автор

The best xdebug presentation that money can buy.Great work.

kurcanu
Автор

For xdebug 3.x+ instead add these to php.ini:

xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_port = 9000

chrise
Автор

Thanks for making videos. You Explain every minute details precisely. I'm currently learning basic programming in Core PHP without using any framework. Love from India.

arjunshinde
Автор

Man you are amazing, thanks.
Please make videos about Automation testing in Yii2 it will be a life saver, the yii2 documentation is just very hard.
I have learnt a lot from you.

juststudying
Автор

Thank you so much i spent the whole day searching for how to set up this xdebug shit

abdullahAboelkhair
Автор

Doesn't work. My file is executed and all breakpoints are ignored.

LuisCarlos-pmmi
Автор

Wow, tNice tutorials opened my eyes to the beauty of soft soft. Your tutorial is as clear as the layout of the program.

chungfeng
Автор

Simple and concise! Great work man! Thanks!

shaheeng
Автор

Thank you very much! Very cool, short and very clear. I will wait for new videos on your channel =)

chistowick
Автор

If your Launch currently open script configuration is not stopping at the breakpoints, it is because your cli is not using the xampp php.ini, rather your computer's php.ini (the php.ini file used when you run php from the terminal, you can run php -a then phpinfo() from terminal, then check config file by searching for php.ini to check path of which file is being used )

abdulbadisabir
Автор

Thank you so much. I follow the steps of your tutorial and it's working for me. Thanks Again

paktvonline