![]() The DLL you'll get must be put in your PHP extensions folder, i.e. Having this info, you should go to the download page for Xdebug and choose the right version for your current setup. If it is enabled, then your version is "Thread Safe" (TS), otherwise, it's "Non-Thread Safe" (NTS). ![]() Thread Safety: check if you have it enabled or not.Architecture: It will tell you if you are using x86 (32 bits) or 圆4 (64 bits).Compiler: Take note of the compiler version (VC11, VC14, etc.).Version: Right at the start of the info page.The first step is to identify your current version of PHP, for which you can create a new PHP file, put a phpinfo(), and then search for the following lines (use Ctrl+F). Note: Since we'll be modifying just the php.ini file, it doesn't matter if you are using Apache, Nginx, Xampp, etc. Remember to say "no" if it asks about adding the extension to your php.ini since we'll be reviewing that later.ĭue to Windows' tendency to make stuff more complicated, installing Xdebug will require many steps. Life is easy for you: just run the following command and you are done. ![]() ![]() Under the hood, this extension uses the DBGp protocol that provides communication between the runtime engine (officially Zend Engine) and the IDE.įor this article, I assume you have already installed Visual Studio Code and the PHP runtime. Xdebug is a PHP extension that gives the capabilities to debug and profile of our code, allowing us to inspect variables and check calls step-by-step. Having worked previously with other languages like C# or Java, I've learned to use breakpoints to inspect my code, and that is possible too in PHP thanks to Xdebug. Have you ever faced a piece of code written in PHP that doesn't work as it should? If you don't have much experience debugging applications, surely you would have used error_log() and var_dump() a lot to inspect your variables, which works, but it could be better.
0 Comments
Leave a Reply. |