Please consider though that I have very little experience in this. If you have any questions I will do my best to help. If all is working for you, you should now be ready to use Xdebug, PhpStorm and MAMP. You can now run the debugger and it will stop at your breaking point. Fix mapping !() PhpStorm set mapping !() PhpStorm fix mapping !() PhpStorm run debuggerĬheck the debugger for the mapping error and untick the mapping. !() PhpStorm remote connection Xdebug 13. Set your choice on your project root folder. PhpStorm should recognize at this point the remote connection and ask you what you want to debug. Set breaking pointsįinally… In PhpStorm just click into the line on the left. Start debugging in browser !() Xdebug Helper start debug Turn on via: Go to Run -> Start Listening For PHP Debug Connections !() PhpStorm Listen Debug Connections 9. !() PhpStorm setup Project !() PhpStorm add new local server !() PhpStorm setup local host !() PhpStorm specify web path 8. In our case we will open project wp-test. Make sure you set the correct project root and setup the localhost with the correct port. Start PhpStorm and setup project with localhost !() Xdebug Helper Options !() Xdebug Helper IDE key 7. The Xdebug Helper should be at the bottom. In your Xdebug Helper browser extension go to Options via chrome://extensions/. Make sure you restart your MAMP server after editing your php.ini file, otherwise your settings wont apply. Your Xdebug section should be at bottom of your php.ini file. Zend_extension="/Applications/MAMP/bin/php/php5.5.3/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so" bash_proile doesn’t exist touch ~/.bash_profile open ~/.bash_profileĮnter the following at the bottom of your. Set your PHP version globally (optional)Įither create or open your. Find Your PHP version in MAMP !() Find your PHP version in MAMP 2. OSX 10.7 Xdebug Phpstrom Mamp Install Guide 1. You should be able to copy paste all commands. Note I will be doing most work from the terminal. There are plenty of steps to do in order to get this to work. Here is how those two options look like in PhpStorm: !() Xdebug PhpStorm Direct vs Remote The second method is the remote debugging where anywhere in you code you set a break point and essentially trigger the debugging remotely, in our case a browser. To do that, in PhpStorm’s settings, under Languages & Frameworks -> PHP, click on the More button, next to the CLI Interpreter dropdown list, which you can see an example of in the screenshot below. So you need to know exactly where to start and all files you want to debug need to be somehow connected (told you I am no expert on this…). Now that Xdebug’s installed and configured, we need to configure PhpStorm. The first one essentially is essentially like running php from your command line using Xdebug. Essentially you can find two types of debugging. If anybody knows the proper terminology, please leave them in the comments and I am more than happy to change this. I am no expert on this topic, so apologize my language. As seen on: Link to YouTube Subscribe to my channel Two different types of Xdebug modes
0 Comments
Leave a Reply. |