- Visual Studio For Mac Debug Tests
- Visual Studio For Mac Debugger Panic
- Visual Studio For Mac Debug Unit Test
In Visual Studio Code install php-debug, and in MAMP PRO under the PHP tab check the checkbox to debug with Xdebug. Then in Visual Studio Code in the debug view, click the gear icon and choose PHP. Then in Visual Studio Code in the debug view, click the gear icon and choose PHP.
- Debugging is a common, and necessary, part of programming. As a mature IDE, Visual Studio for Mac contains a whole suite of features to make debugging easy. From safe debugging, to data visualization, this article will explain how to use the full potential of debugging in Visual Studio for Mac.
- Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows. Download Visual Studio Code to experience a redefined code editor, optimized for building and debugging modern web and cloud applications.
I use Visual Studio Code IDE on a Mac, and the MAMP stack to develop a website with PHP.
I want to debug the PHP.
I saw this post about debugging PHP with the visual studio code extension: php-debug.
I installed it in my visual studio code but I see that I need to download Xdebug for it to work.
I see on the Xdebug website that it has no download files for Mac OS X.
However, some PHPdebuggers for mac are Xdebug clients for mac. As shown here.
Does this mean that I can somehow download Xdebug for mac OS X so that my Visual Studio Code php-debug extension works?
If so how?
If not, what is my next best option? - Can I use Visual Studio Code IDE to develop with and a completely separate tool to debug PHP with? In that workflow, would I be just running the site in the browser and the third party tool stops on the breakpoints?
Visual Studio For Mac Debug Tests
I downloaded codebug for mac, and opened my project in it, and put break points on the code, then ran my website locally. The code did not stop on the break points. What was I missing?
Thanks.
1 Answer
Visual Studio For Mac Debugger Panic
The route I took is upgrading to MAMP PRO. It may be possible to do it with MAMP (non-pro) if you do a bit more setup work for Xdebug.
Upgraded to MAMP PRO and adapted this tutorial for Visual Studio Code. In Visual Studio Code install php-debug, and in MAMP PRO under the PHP tab check the checkbox to debug with Xdebug. Then in Visual Studio Code in the debug view, click the gear icon and choose PHP. This creates a launch.json file. Save the file without changing any defaults, unless you know your xdebug is on a different port. Then just press the play button in the debugger in Visual Studio Code, enter in some breakpoints into the PHP code, and browse to the website. The debugger should stop the execution on the breakpoints.
BeniaminoBagginsBeniaminoBaggins