Simply navigate to the PHP section in MAMP and take note of what you’re default PHP version is. However, if you are using an older verion of MAMP, or if you want to ensure that MAMP 3 is indeed configured correctly, you’ll first need to identify what version of PHP you’re using with MAMP. And that should be it, at least for MAMP 3.įor most of you reading this, you can just stop here and move onto the PhpStorm section. You can enable Xdebug within MAMP by checking the Activate Xdebug option under the PHP tab. Xdebugįortunately, Xdebug is already included with MAMP, so there is nothing we need to install in addition to MAMP itself. I also assume that most of this is applicable to the regular, non-pro version of MAMP, though I have not tested it. The same process should also work for MAMP PRO 2 - 4 and for PhpStorm 7 - 2016.2. The screenshots below are from MAMP PRO 3 and PhpStorm 8. So your initial setup isn’t as frustrating as mine was, I thought I'd share how I was able to get it all wired up and hopefully save you some time. After a few days mucking with everything, I was able finally able to get it figured out. Each article seemed to be missing one key piece of the puzzle. I must have read 8 - 10 articles scattered about the internet to finally get PhpStorm setup to do debugging with Xdebug and MAMP. Flexible use of xdebug can help improve commissioning efficiency.Michael Novotny How to Setup and Configure Phpstorm, Xdebug, and Mamp for Debugging January 6, 2015 The advanced usage methods are described in other articles. Xdebug itself has a large number of built-in functions to analyze PHP program performance bottlenecks and other issues. Summary: Xdebug can be used to track, debug and analyze the health of PHP programs. PHP.ini: Xdebug.remote_port = 9000 Phpstorm: 4. Additional Note: 3.1 If the port is occupied, you can configure Xdebug.remote_port in php.ini with the same debug port in Phpstorm. Operation Flow: Break Point-click Bug-click Browser page Trigger breakpoint-auto jump back to phpstorm-> view carried data (for debugging purposes), you can follow the steps to find problem points, click Run (or F5) Debug complete with Browser page continueģ. Of course, the ability to view information is equivalent to using Echo,print or var_dump. From there, you can see all the data information that the program contains when it runs here. Local server configuration Details View 2.4 Use the debug feature to make a breakpoint on the line that needs to be debugged (click on the blank space after the line number, One more time to cancel the breakpoint), it should be noted that when the program runs to the breakpoint, the program stays on the line, but the row itself does not execute. 2.3 Configure Phpstorm drop-down Select Edit configurations, configure server information, add Project Debug Development address, click OK. Put the following code into any PHP file, and the browser can access it. To see if Xdebug is successful, print phpinfo. Locate the directory where php.ini is located, add the following text at the end of the file (if it already exists, leave the preceding semicolon remove) zend_extension_ts= "D:/wamp/bin/php/php5.5.12/zend_ext/php_ Xdebug-2.2. "//xdebug storage path, xdebug.remote_enable=on//whether to allow remote terminal, this must be turned on xdebug.profiler_enable = Off// Performance optimization, this article does not use, select Off (do not close, will be about hundreds of m per minute to generate a large number of log files, not one day your hard drive on the cry) xdebug.idekey= "phpstorm" //here is the Debugger keyword save, restart the server. I use the wampserver,php and Xdebug have been downloaded. Phpstorm version: 8.0.3PHP version: 5.5.12xdebug version: Php_xdebug-2.2. Note: The PHP version and the Xdebug version must correspond.
0 Comments
Leave a Reply. |