

- #MAMP UPDATE XDEBUG HOW TO#
- #MAMP UPDATE XDEBUG MAC OSX#
- #MAMP UPDATE XDEBUG INSTALL#
- #MAMP UPDATE XDEBUG PRO#
- #MAMP UPDATE XDEBUG CODE#
Add some breakpoints, start the debugger and it will stop when that code is run.

Make sure PHP Debug is set to "Listen for Xdebug" and you should be good to go.
#MAMP UPDATE XDEBUG HOW TO#
The default configuration should do to begin with, for more information on how to configure PHP Debug check out the extension docs.Īutomatically generate a config file for PHP Debug Choose PHP as you environment and VSCode will generate a launch.json file.
#MAMP UPDATE XDEBUG INSTALL#
If that is your case as well, you do not need to install Xdebug. First, I am actually using MAMP for local development. Open the dropdown where it says ”No Configuration” and click ”Add configuration. Ok, so I finally found the solution to my problem. Open the debug panel in the VSCode side bar. If you are using an older version of VSCode you may need to reload the editor after installing the extension. Search for PHP Debug in the VSCode extensions and install it. The PHP version should be there already depending on what you MAMP settings are.Īfter saving and exiting MAMP should restart.ģ. Find the Xdebug section (likely on the bottom of the file) and make sure it looks like this:

When still inside MAMP Pro, open File > Edit template > PHP (php.ini) and select the version of PHP you are running.
#MAMP UPDATE XDEBUG PRO#
If you are using regular MAMP and not the pro version this guide is roughly equivalent to step one and two. You should now be able to open up a Terminal window and run drush commands and if you set any "breakpoints" in your drush code (such as in DRUPAL_ROOT/drushrc.php or in DRUSH_ROOT/drush.php) Eclipse will "break" on those lines.Make sure that Xdebug is enabled in the PHP section of MAMP. That will *remove* the "drush" folder from source, and then re-add it - this is what you need so you can navigate to the source and set breakpoints etc. To fix the "conflict" click "Update exclusion filters in other source folders to solve nesting." This will create a "conflict" (since it is essentially creating an Eclipse "link" in your Project Source (not a Unix Link). Open up your Project Properties (select Project | Properties)Ĭlick the "Browse." button and browse to where your drupal.php file is (mine is at: /usr/local/pear/share/pear/drush) This is the part I had a problem with at first. Select "Create project at existing location (from existing source)īrowse to find the ROOT of your Drupal installation (mine is at /Applications/MAMP/htdocs/gst)įor "Project Layout" I chose "Use project as source folder" (although I'm thinking you could choose "Create Separate folders." and that might also work, but is not what I did).Ĭlick "Next" and it will create a project with the name you typed.

Create a PHP project in Eclipse for your Drupal Source.Add the XDEBUG_CONFIG setting to your local ~/.profile | ~/.bash_profile as per: here.Īlthough since I am using Eclipse, I have set mine to:.Configure MAMP/Eclipse/XDebug per: here.XDebug 2.1 (this version now ships with MAMP)
#MAMP UPDATE XDEBUG MAC OSX#
I just configured my Mac OSX 10.7 (Lion) to perform CLI debugging with drush by doing the following: I wasn't able to get CLI debugging working this way although it seems that Moshe has been able to do this. When you create a normal web project in Netbeans it has an option "Do not open in Web Browser". I wasn't able to get this working so that I could just run a command from the CLI and it would be captured in the IDE. Remember to put in a break point or have "Stop at first line" checked in the Netbeans Preferences. You then debug by hitting the debug button, it should be on the toolbar or go to Debug -> Debug Project. 3 - Project properties: run configuration. The following screenshots show the two applicable settings pages.įig. Once the project is created, right-click on the Project name in the side-bar and select "Properties". I then created a new project in Netbeans, with the root directory of the project being where Drush lives (although I have a feeling it doesn't matter where the root is). Ln -s /Applications/MAMP/bin/php5.2/bin/php /usr/bin/php Netbeans config Note that you can fiddle with php.ini and retry quickly since apache is not involved and thus nothing needs restarting. Try to turn on logging by changing the last line and see if you get any useful info. Xdebug.profiler_output_name=cachegrind.out.%R My php.ini has zend_extension=/opt/local/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so Its in an advanced tab.Īlso, use Xdebug 2.1 Final release as earlier releases had problems. One tip is to setup netbeans so that it does not open a browser window when starting a debugging session. php.ini for the CLI) and the netbeans client setup properly. Mostly, this requires a lot of patience and googling.
