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 .
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!
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.
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
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!!
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!
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: zend_extension=PATH_TO_PHP_XDEBUG.DLL 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: php_xdebug-3.0.1-8.0-vs16-x86_64.dll
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.
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.
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 )
If your version of XDebug is 3.0 or later, as it probably will be as of the time of this comment, replace the lines at 2:50 with the following: zend_extension="C:\XAMPP\php\ext\php_xdebug.dll" xdebug.mode = debug xdebug.start_with_request = yes
Man you type fast, Man I'm so impressed with how fast you type and you talk real fast too talking fast and typing fast are the the impressive things you do. The only impressive things you do.
He had recorded the video earlier then edited it and then he did voice-over so that it looks real You can identify this by the speed of the blinking cursor.
Hi. Very clear and precise. However, the debugger does not stop at my codes, though I tried the steps explain. The very first debug, Launch currently open script, runs without stopping at the break point. Any advice please. Thank you
Great video. There is a thing with wordpress though, everytime I put a breakpoint somewhere it stops at that position or somewhere neraby with an exception for instance " Call to undefined function add_action()" , but there is no error when I load the page normally. Maybe it is not aware of the wordpress system or something?
@@TheCodeholic Yes it loads with no problem when not debugging. I tried another project with laravel, and put a breakpoint in a service provider. Then I get: "Class 'Illuminate\Support\ServiceProvider' not found". If I reload the page there is a different error: "Symfony\Component\HttpKernel\Exception\NotFoundHttpException:". I use a virtual domain in local development, I don't know if that's related to the issue..
@@TheCodeholic Maybe it's because I "run currently open script" and then it runs only that script in isolation. I can check the manual I guess. - - - - - edit: now it works, I should just use "Listen for Xdebug" and run through browser!
Hi, when im using launch currently open script and i change URL to see how different routes in my application work (router based on url params) it gives me always the default routing. Do I need to somehow link the URL with the folder being debugged? And another thing Listen for Xdebug is not working at all even after refreshing the page no lines highlited only the bar with pause, restart and stop button. Thanks for any answers
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
If you are using xampp you need to have project under htdocs folder. However you might have xampp installed on different location than c:/xampp. In this case it does not matter.
I done the same thing`s as you and i can`t debug my code. Variables are not displayed and the breakpoint used is not showing. Even my launch.json file displays 2 problems : " Matches multiple schemas when only one must validate."
Good but why in my break point is not stopping in $person = new Person('Ashique'); this line? It completes the all lines and echo the output to Debug console :( Could you explain? Thanks
@@TyrboCreed i have solved the issue. Just replaced then old dll file to new dll file. I think no need to download new xdebug.dll file if you use xampp then xampp comes with a php_xdebug.dll.
Hey, Can someone help me with an issue ? I can debug php files in /public folder but when i want to debug (open script) my controllers (src/controller) i have an error: "HP Fatal error: Uncaught Error: Class "Symfony\Bundle\FrameworkBundle\Controller\AbstractController" not found in C:\Desktop\workplace\test\src\Controller\TestController.php". My controller extends AbstractController and I have it in vendor/symfony/framework-bundle/controller... Any idea ?
Did everything you showed with no problem. Started with Launch open script. Nothing. The debugger icon shows up, and the controls the step controls are disabled. If I close the debugger the debug icon goes away and will not appear again unless I restart VSC. Not sure why this is happening.
Coming to this video in Oct 2022, I wonder if there is a new step that is needed here. I followed all steps exactly (twice) and at the 4:02 timestamp, my VS Code just runs the PHP file and outputs the echo to the Debug Console without stopping on the breakpoint. Does anyone know if there's another missing step now?
what happened to me? I just keep having this notice PHP executable not found. Install PHP and add it to your PATH or set the php.debug.executablePath setting from vscode
any one who is here with latest xampp (PHP 8) + xcode (3), --- this is not the video for u. --- this same author has made another vid ua-cam.com/video/HrQWtbxY1Hs/v-deo.html
i cant understand no matter how many times i watch this. can someone please link me a more in-depth tutorial of xdebug? what does a breakpoint do? can u debug without setting a breakpoint? what does this debug do?
Hello, I've followed every steps of your tutorial, but when I launch debuging in currently open file, it runs trough every breakpoint without stoping and print the result in the debug console. I also tried "listen for Xedbug" but it doesnt do anything at all I've installed Xamp in c:/Xamp but I dont understand what's happening right now. Could it be port that are already in use ? I've tried tons of things but I am kinda lost right now
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
let's dislike it - you talk about php debugging, I think you address this tutorial for a new php developer, just the code is nor for a new php developer.. so useless guide... I don't understand anything as I have never done a code in oop mode ...
Thank you for your feedback. I will consider that for my next video On debugging. I plan to redo this video and simlify that. P.S. It does not matter if you do debugging on functional way or OOP way. debugging is the process to find out bugs in your code. And it also does not matter what code the project contains. The only requirement of the video is to know what is debugging in general. But as I said I will consider your feedback
🔥🔥🔥 Check my full course "Build and Deploy Laravel E-commerce Website with Vue.js Admin Panel" at thecodeholic.com 🔥🔥🔥
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 .
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!
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.
Thanks, man. At last, you helped me.
I was here in the comment section for this reason only.
Thankyou So much.
And many thanks for me as well! Came to the comments just to find this
God
Yes, found this a key step also to have debug recognize the browser in Listen for Xdebug mode. Thanks so much.
Pay attention to the port. It should be the same as in launch.json file. In my case it was 9003, not 9000. And it was the problem in my case.
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
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!!
Thanks a lot. Appreciate buddy.
nice to see a person that acknowledges his faults instead of hiding them, that's mature and tells me alot about you :).... please don't change
Wonder-full waited for this for a long time after shifting from C# to PHP
The best xdebug presentation that money can buy.Great work.
You really understand better what developer needs, you saved my time with this tool. thanks again.
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!
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:
zend_extension=PATH_TO_PHP_XDEBUG.DLL
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: php_xdebug-3.0.1-8.0-vs16-x86_64.dll
Great help, thanks!
THANK YOU very much.
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.
Thank you
Best php developer in youtube 🧨
Huge thanks. Appreciate!!
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.
Simple and concise! Great work man! Thanks!
man you are a king. thanks a lot.
Wow, tNice tutorials opened my eyes to the beauty of soft soft. Your tutorial is as clear as the layout of the program.
Спасибо большое! Заработало)))
Works like charm!
Thank you,.!!!!!!!!!! You helped me a lot, I am watching you from Brazil.
Glad to hear that!
Thank you so much i spent the whole day searching for how to set up this xdebug shit
back a year later and still many thanks😅
Thanks for the explanation
Welcome
Thanks for this, much appreciated.
thank you! this video very useful
Welcome
yours sir, worked for me, thanks for this video !
thanks for this :) hoping to see one for dockerized app.
thanks for it, you are a star!
Wow, thanks!
For xdebug 3.x+ instead add these to php.ini:
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_port = 9000
Working with "Launch currently open script", but not with "Listen for xDebug".
Thx anyway.
Thank you! this was driving me crazy but with this I could make it work. btw, I'm using Laragon
Been stuck on this for a few hours; this fixed it. Thank you!!
Thanks man...Worked for me.
This one saved me. Thank you creator and Chris E!
Thank you for the great explanation!
Can I ask what VsCode theme and font are you using?
Thanks!
Thank you so much. I follow the steps of your tutorial and it's working for me. Thanks Again
Thank you
than you ..
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 )
thank you i learn now and benefited from this video
Thank you very much! Very cool, short and very clear. I will wait for new videos on your channel =)
Thank you. I am working on something interesting which will be released in next week
soft is rather complex.. sotNice tutorialngs more than they should be. But you've made a great job explaining it!
Glad it was helpful!
bang on! thanks for the video!
Thank you. It works very well.
So clear! Thank you mate!
Glad it helped!
Nice video 👏🏼👏🏼🔥
Thanks for amazing content. Great explanation is just like I needed. Time for less headaches :)
Thanks a lot
this is very handy, thank you very much!
Thank you sir, it really works.
very clear explications, thank.
Thanks man!
Welcome
Great video. Thanks!
If your version of XDebug is 3.0 or later, as it probably will be as of the time of this comment, replace the lines at 2:50 with the following:
zend_extension="C:\XAMPP\php\ext\php_xdebug.dll"
xdebug.mode = debug
xdebug.start_with_request = yes
Thank u
Thank You ! It helped
What theme do you use in your vscode work style?
Great! Thx!
Welcome
Thank you. Subscribed :D
Great Job !
What a amazing video! Thank you, sir! Helped me a lot.
Zura janai Katsura da !
exceptional :)
Thank for video, can you showcase how to setup xdebug in WSL2 using laradock or docker.
Cannot figure it out.
Man you type fast, Man I'm so impressed with how fast you type and you talk real fast too talking fast and typing fast are the the impressive things you do. The only impressive things you do.
He had recorded the video earlier then edited it and then he did voice-over so that it looks real You can identify this by the speed of the blinking cursor.
Thank you!
You're welcome!
Thanks man for this videos
but Listen for xdebug isn't working for me
when i refresh the page
with out make any error
How to debug on vs code and php laravel app in a docker?
Hi. Very clear and precise. However, the debugger does not stop at my codes, though I tried the steps explain. The very first debug, Launch currently open script, runs without stopping at the break point. Any advice please. Thank you
Maybe you use xdebug 3.
Check my other video (uploaded about 6-7 weeks ago) which is using xdebug 3.
@@TheCodeholic Hi. Yes using xdebug 3. Pleaase share new link. That will help
Thank you
Hello again. I'm using PHP 7.4 with xdebug 3. Should i rather downgrade to xdebug 2, or PHP 7.4 and xdebug 3 will work smoothly?
I think you should update to PHP8.1
Great video. There is a thing with wordpress though, everytime I put a breakpoint somewhere it stops at that position or somewhere neraby with an exception for instance " Call to undefined function add_action()" , but there is no error when I load the page normally. Maybe it is not aware of the wordpress system or something?
It does not care whether it is wordpress or magento. It should work. Please check if it really works without debug
@@TheCodeholic Yes it loads with no problem when not debugging.
I tried another project with laravel, and put a breakpoint in a service provider. Then I get:
"Class 'Illuminate\Support\ServiceProvider' not found".
If I reload the page there is a different error: "Symfony\Component\HttpKernel\Exception\NotFoundHttpException:".
I use a virtual domain in local development, I don't know if that's related to the issue..
@@TheCodeholic Maybe it's because I "run currently open script" and then it runs only that script in isolation.
I can check the manual I guess.
- - - - -
edit: now it works, I should just use "Listen for Xdebug" and run through browser!
Exactly.
Yiu have to debug in browser
How do u configure debugging on a Mac
Hi, when im using launch currently open script and i change URL to see how different routes in my application work (router based on url params) it gives me always the default routing. Do I need to somehow link the URL with the folder being debugged? And another thing Listen for Xdebug is not working at all even after refreshing the page no lines highlited only the bar with pause, restart and stop button.
Thanks for any answers
Please could you help me, I do all steps in video but xdebug not work in vs code with php
emphasis on shit, I really hate php
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
@@ahmaddeveloper1329 not work with me
Hi, Is the process the same if I have a project in a different location (not default /xampp/htdocs)? Any extra configuration needed?
If you are using xampp you need to have project under htdocs folder.
However you might have xampp installed on different location than c:/xampp. In this case it does not matter.
I done the same thing`s as you and i can`t debug my code.
Variables are not displayed and the breakpoint used is not showing. Even my launch.json file displays 2 problems : " Matches multiple schemas when only one must validate."
Good but why in my break point is not stopping in $person = new Person('Ashique'); this line?
It completes the all lines and echo the output to Debug console :(
Could you explain?
Thanks
@@TyrboCreed i have solved the issue.
Just replaced then old dll file to new dll file. I think no need to download new xdebug.dll file if you use xampp then xampp comes with a php_xdebug.dll.
what we have in person.php ?
1:08 zura janai katsura da!
Hello. Xdebug 3 is out, a lot things has been changed. Can you please publish a new video?
I think I will do, just I am not sure exactly when
hi sir ,can you make video on remove xdebug file ?
Debug PHP is no longer in the Extensions in Visual Studio. Any thoughts?
it is called PHP Debug . It is still in the extension i still installed it
it opens another file in atom . what does it means if the debugger is in working conditions
Hey, Can someone help me with an issue ? I can debug php files in /public folder but when i want to debug (open script) my controllers (src/controller) i have an error: "HP Fatal error: Uncaught Error: Class "Symfony\Bundle\FrameworkBundle\Controller\AbstractController" not found in C:\Desktop\workplace\test\src\Controller\TestController.php". My controller extends AbstractController and I have it in vendor/symfony/framework-bundle/controller... Any idea ?
receive this error:
If anyone receives Server error: Error: spawn php ENOENT then just install PHP Server
plugin..might be helpful for someone :)
Which plugin? where can I find it? please tell me.
Did everything you showed with no problem. Started with Launch open script. Nothing. The debugger icon shows up, and the controls the step controls are disabled. If I close the debugger the debug icon goes away and will not appear again unless I restart VSC. Not sure why this is happening.
same here....
3:49 follow carefully everything must be sorted out.
have problem, don`t work with php 8 (
Error: listen eaddrinuse address already in use:::9003
did you get the answer?
@@akshaysb526 don't have answer, how fix that.
Doesn't work. My file is executed and all breakpoints are ignored.
Remove the ones shown in this video if u using v3
Lol
Coming to this video in Oct 2022, I wonder if there is a new step that is needed here. I followed all steps exactly (twice) and at the 4:02 timestamp, my VS Code just runs the PHP file and outputs the echo to the Debug Console without stopping on the breakpoint. Does anyone know if there's another missing step now?
Please check my recent video about debugging that uses xdebug3. Your problems should be fixed there.
@@TheCodeholic Ah, very good yes! That worked thank you!
I followed the same steps but doesn't work, some help please!!
What exact error do you get? Can you provide screenshot?
Hi,
I've reinstalled everything ( xampp php vscode etc )
Still getting this error
"Error: spawn php ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:264:19)
at onErrorNT (internal/child_process.js:456:16)
at processTicksAndRejections (internal/process/task_queues.js:81:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn php',
path: 'php',
spawnargs: [ 'c:\\xampp\\htdocs\\work\\test.php' ]
}"
Any idea? Thanks!!
Where do you get this error? After what action?
@@TheCodeholic asfter installing php debug and running the 'launch currently'
what happened to me? I just keep having this notice
PHP executable not found. Install PHP and add it to your PATH or
set the php.debug.executablePath setting from vscode
Had the same problem. This video help me fix it ua-cam.com/video/NAvMN2tqBZM/v-deo.html
why i don't have php.ini?
Why??? I can't download the file xdebug
Can anyone help me with how to adjust it in Linux and docker?
Unfortunately I have not done it.
Check this link. it might help.
matthewsetter.com/setup-step-debugging-php-xdebug3-docker/
What about pho storm ?
I already have video on PHPStorm.
Have you paid for using php storm, because I can't afford it due to its pricing so I mostly use VSCode editor for my daily practice.
@@arjunshinde7 VSCode is sufficient in 95% cases, PHP Storm is for those who are full stack dev working for company.
any one who is here with latest xampp (PHP 8) + xcode (3),
---
this is not the video for u.
---
this same author has made another vid
ua-cam.com/video/HrQWtbxY1Hs/v-deo.html
How to config into mac?
I believe the way will be similar. You just need to edit php.ini file.
The XDebug wizard featured in the video should give you a precise set of constructions configured for your environment.
i cant understand no matter how many times i watch this.
can someone please link me a more in-depth tutorial of xdebug?
what does a breakpoint do?
can u debug without setting a breakpoint?
what does this debug do?
Watch some videos on YT about what is debugging in general and then everything will become clear
when i click the play button nothing happend
Same with me. When I click button, the script is executed and all breakpoints are ignored.
Hello, I've followed every steps of your tutorial, but when I launch debuging in currently open file, it runs trough every breakpoint without stoping and print the result in the debug console.
I also tried "listen for Xedbug" but it doesnt do anything at all
I've installed Xamp in c:/Xamp but I dont understand what's happening right now.
Could it be port that are already in use ?
I've tried tons of things but I am kinda lost right now
to go hahahaha
$ php -i to get the phpinfo without writing code.
doesn't work in 2021
The problem might be in XDebug version.
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
@@ahmaddeveloper1329 v3.0 : "version": "0.2.0",
"configurations": [
{
"name": "Listen for XDebug",
"type": "php",
"request": "launch",
"port": 9000
},
{
"type": "php",
"request": "launch",
"name": "Run using local PHP Interpreter",
"program": "${file}",
"runtimeExecutable": "C:\\xampp\\php\\php.exe"
}
],
} this is for json. and this is for php.ini: [XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug-3.0.2-8.0-vs16-x86_64.dll"
xdebug.mode = debug
xdebug.start_with_request = yes
xdebug.client_port = 9000
xdebug.client_host = "127.0.0.1"
xdebug.log = "C:\xampp\tmp\xdebug\xdebug.log"
xdebug.idekey = VSCODE
@@vladeb1104 thanks a lot, it works for me
followed all the instructions exactly. didn't work at all
Which PHP and Xdebug versions do you have?
Do you get any error?
@@TheCodeholic figured it out. mine wasn't enabled OOB had to do more to my PHP ini file
THIS SHIT NOT WORKING
I'm not talking about your tutorial but xdebug
Which version of PHP do you have?
let's dislike it - you talk about php debugging, I think you address this tutorial for a new php developer, just the code is nor for a new php developer.. so useless guide... I don't understand anything as I have never done a code in oop mode ...
Thank you for your feedback.
I will consider that for my next video On debugging.
I plan to redo this video and simlify that.
P.S.
It does not matter if you do debugging on functional way or OOP way. debugging is the process to find out bugs in your code.
And it also does not matter what code the project contains.
The only requirement of the video is to know what is debugging in general.
But as I said I will consider your feedback
its not about the code but the ability to debug via xDebug and VS Code, as it says in the title
thank you