Mamp Debugger not installed

Hi,

I think about switching from Netbeans to PhpStorm but I am still having troubles with debugging.

I uses Mamp Pro und followed the tutorial here:
https://confluence.jetbrains.com/display/PhpStorm/Installing+and+Configuring+MAMP+with+PhpStorm+IDE#InstallingandConfiguringMAMPwithPhpStormIDE-IntegratingthePHPexecutable

After adding my php-executeable phpstorm tells me that my debugger is not installed:

Debug.png
If I use the phpinfo button it indeed tells me that xdebug is not there. But actually it is present in my MAM -php.ini and I can connect to xdebug with Netbeans and MacGDBp.

Did I forget someting? The tutorial says:

Please note that if you are using latest MAMP PRO, httpd.conf, php.ini and my.cnf files should be edited through the Template Editor provided by MAMP PRO.


So phpstorm should use my MAMP-php.ini settings, but obviously it doesn´t (there are some more parameters like memory_limit which are different in the phpstrom-phpinfo and the results I get If I run phpinfo directly on my server.

Thanks for your help

Rob

4 comments
Comment actions Permalink

Hi there,

In your terminal, navigate to the folder where that php executable is located and execute "php -v" -- do you see mention of xdebug there?

Thing is: most likely you have 2 separate php.ini files: for CLI and Web (Apache). PHP Interpreters in PhpStorm use CLI interface .. and you may not have xdebug enabled/configured there.

When PhpStorm detects your interpreter details, it basically executes "php -i" (or similar command that produces similar output) -- it does not specify what ini file to be used -- PHP itself selects the most appropriate one.

If you will be using debugging via web interface (browser) then you may ignore what it says here as PhpStorm cannot influence what PHP interpreter your Apache is using.

P.S.
See what php.ini file is used (is shown in "php -i"/"<?php phpinfo();" output header).

0
Comment actions Permalink

Thanks for your answer!

You are right, there ist no mentioning of xdebug if I use "php -v".

When I click on the debug button (the "bug") just as I do in Netbeans I get the message "Connection was not established: debug extension is not installed."

But If I just "Listen for PHP Debug Connections" it is working and I can access my breakpoints. Strange.

So I would change my debug behavour. It´s working and that´s good, but are there any disadvantages to debug that way?

0
Comment actions Permalink

Please read it first: https://confluence.jetbrains.com/display/PhpStorm/Debugging+with+PhpStorm

When I click on the debug button (the "bug") just as I do in Netbeans I get the message "Connection was not established: debug extension is not installed."

But If I just "Listen for PHP Debug Connections" it is working and I can access my breakpoints. Strange.

Details/screenshots please. Without context it could be anything.

PhpStorm relies on Run/Debug Configurations (the dropdown box next to Run/Debug buttons). Debug button can do diifferent thing based on what configuration is currently selected.

For example -- you may be trying debugging CLI script where you may indeed have no xdebug installed .. but it works for "Listen..." because script is executed via browser/Apache whichuses different php.ini where debugger is installed.

So yes -- you may need to edit correct php.ini to enable xdebug there. Exact path to the php.ini used by specific environment can be seen in header part of the output povided by phpinfo() -- if you execute a simple script with that function in it via CLI and browser you may see that 2 different php.ini files were used.

0
Comment actions Permalink

Thanks for your help - I found a solution to my problem:

First I changed my commando line php to the MAMP-version (based on this post: http://www.kaltura.org/php-cli-install-mac-using-mamp):

sudo mv /usr/bin/php /usr/bin/php-old

sudo ln -s /Applications/MAMP/bin/php5.3.29/bin/php /usr/bin/php


Then this php.ini is in charge:

/Applications/MAMP/bin/php/php5.3.29/conf/php.ini

This is not the file MAMP uses for the Web PHP, so all configurations in there - like xdebug - have to be added again.

No debugging works like a charm again :-)

0

Please sign in to leave a comment.