I had xdebug working with PHPStorm ok. I have not used it for a few weeks and when I tried to debug a file yesterday the debug window returned "Connection with 'xdebug' was not established. Validate installation." When I validated the installation I get "'xdebug' extension is not installed. Show phpinfo."
When I run phpinfo.php the output clearly states that xdebug IS installed. This has been confirmed by running the wizard on xdebug.org against my phpinfo which outputs
I am running
I have spent a day on this so far trying to figure it out but not making any progress. Any help or ideas would be appreciated.
1) Try upgrading xdebug to the latest stable version: 2.2.1
2) Check firewall -- xdebug is the one that initiates connection to IDE, not other way around. If you are behind the router (e.g. server is on Internet), then you will have to do port forwarding on your router).
3) Are you running it on the same computer as PhpStorm (I mean -- not in virtual environment) ?
4) Would be good to see your xdebug settings from php.ini (or whatever file is used there) as well as output from phpinfo() (header one and xdebug specific section)
Some useful links (in case you have not seen them yet):
Thanks Andriy for your prompt response.
Thanks for the links - I will take a look. I have read lots of material on the web, but not sure I have seen these, thanks.
I have all of this configured locally so the firewall should not be the issue here I think.
I will try the xdebug upgrade.
The php.ini file entries are as follows:
|Build Date||Sep 15 2011 11:18:57|
|Configure Command||'./configure' '--with-mysql=/Applications/MAMP/Library' '--with-apxs2=/Applications/MAMP/Library/bin/apxs' '--with-gd' '--with-jpeg-dir=/Applications/MAMP/Library' '--with-png-dir=/Applications/MAMP/Library' '--with-zlib' '--with-freetype-dir=/Applications/MAMP/Library' '--prefix=/Applications/MAMP/bin/php/php5.3.6' '--exec-prefix=/Applications/MAMP/bin/php/php5.3.6' '--sysconfdir=/Applications/MAMP/bin/php/php5.3.6/conf' '--with-soap' '--with-config-file-path=/Applications/MAMP/bin/php/php5.3.6/conf' '--enable-track-vars' '--enable-bcmath' '--enable-ftp' '--enable-gd-native-ttf' '--with-bz2=/usr' '--with-ldap' '--with-mysqli=/Applications/MAMP/Library/bin/mysql_config' '--with-sqlite' '--with-ttf' '--with-t1lib=/Applications/MAMP/Library' '--enable-mbstring=all' '--with-curl=/Applications/MAMP/Library' '--enable-dbx' '--enable-sockets' '--enable-bcmath' '--with-imap=shared,/Applications/MAMP/Library/lib/imap-2007e' '--enable-soap' '--with-kerberos' '--enable-calendar' '--with-pgsql=shared,/Applications/MAMP/Library/pg' '--enable-dbase' '--enable-exif' '--with-libxml-dir=/Applications/MAMP/Library' '--with-gettext=shared,/Applications/MAMP/Library' '--with-xsl=/Applications/MAMP/Library' '--with-pdo-mysql=shared,/Applications/MAMP/Library' '--with-pdo-pgsql=shared,/Applications/MAMP/Library/pg' '--with-mcrypt=shared,/Applications/MAMP/Library' '--with-openssl' '--enable-zip' '--with-iconv=/Applications/MAMP/Library'|
|Server API||Apache 2.0 Handler|
|Virtual Directory Support||disabled|
|Configuration File (php.ini) Path||/Applications/MAMP/bin/php/php5.3.6/conf|
|Loaded Configuration File||/Library/Application Support/appsolute/MAMP PRO/conf/php.ini|
|Scan this dir for additional .ini files||(none)|
|Additional .ini files parsed||(none)|
|Zend Extension Build||API220090626,NTS|
|PHP Extension Build||API20090626,NTS|
|Zend Memory Manager||enabled|
|Zend Multibyte Support||disabled|
|Registered PHP Streams||https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar, zip|
|Registered Stream Socket Transports||tcp, udp, unix, udg, ssl, sslv3, sslv2, tls|
|Registered Stream Filters||zlib.*, bzip2.*, convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, mcrypt.*, mdecrypt.*|
|DBGp - Common DeBuGger Protocol||$Revision: 1.145 $|
|Directive||Local Value||Master Value|
|xdebug.dump.COOKIE||no value||no value|
|xdebug.dump.ENV||no value||no value|
|xdebug.dump.FILES||no value||no value|
|xdebug.dump.GET||no value||no value|
|xdebug.dump.POST||no value||no value|
|xdebug.dump.REQUEST||no value||no value|
|xdebug.dump.SERVER||no value||no value|
|xdebug.dump.SESSION||no value||no value|
|xdebug.file_link_format||no value||no value|
|xdebug.remote_log||no value||no value|
Please try 127.0.0.1 instead of localhost (in xdebug.remote_host=localhost). This may help if IPv6 has priority (or something like that -- AFAIK xdebug works with IPv4 only).
Also -- the "verification" -- please describe how do you debug (with screenshots, if possible). Maybe you are missing some step .. or executing wrong Run/Debug configuration (e.g. trying to debug CLI script .. when your PHP may simply be not configured for CLI mode, only for web)...
You can also try v6 EAP build (can be run alongside with v5 as it stores IDE-wide settings in separate folder -- just backup project settings (.idea subfolder) if you plan to go back to v5 to work with that project): http://confluence.jetbrains.net/display/WI/Web+IDE+EAP
I had that set to 127.0.0.1 originally and chnaged it to 'localhost' after reading a post on the web suggesting that may help. I have changed it back to 127.0.0.1 but it makes no difference.
"when your PHP may simply be not configured for CLI mode, only for web" - sorry, not sure how I would find this out?
To use the debugger I
The weird thing is how I did have this configured to work but has now stopped. I do not believe that I have applied any updates to the software, but something must have changed for it to stop working.
I will take a look at v6, thanks.
You need to initiate debug session (to tell xdebug that it need to debug this page). This can be done by adding some parameter to the URL (e.g.
XDEBUG_SESSION_START=session_name -- http://xdebug.org/docs/remote ), via some browser extension (that will add debug cookie for you -- see the same xdebug page), or bookmarklets
I'm not sure what type of Run/Debug Configuration will be created in such case -- possibly "PHP Script" (which is for CLI mode). I suggest creating your own manually of proper type ("Run | Edit Configurations.." or via drop-down box on main toolbar -- the one next to Run/Debug buttons).
Maybe it is just your MacOS updates ... hard to say.
When you "Set the listener on (red handset to green)" -- can you check:
1) what ports/protocols PhpStorm listens to (netstat or similar command)
2) see if you are able to connect to xdebug port via telnet (maybe it is blocked .. or just listens on another port)
I also hope that you do not run any another IDE/software at the same time that is capable of handling xdebug debugging (as port must be available for PhpStorm). But I guess this is rather unlikely to happen as I would expect PhpStorm to inform you that it cannot listen on required port.
Generally speaking -- try checking debug in brand new and very simple project (just few basic lines) -- maybe your project settings are screw up or some accidental misconfiguration ... dunno.
I upgraded to latest version of MAMP (2.1.2) which includes the latest version of xdebug.
Also installed PhpStorm v6 and followed the advice in this post 5 Step Tutorial: PHPStorm + MAMP PRO 2
And it works! big relief.
Many thanks for your help and ideas.
I had the same problem. I install the PHP interpreter some months bebore - older version and XDebug. Today I install the PHPStorm and PHPStorm does not found Xdebug. I try to upgrade PHP and XDebug to the oldest version. I found XDebug in the php configuration phpinfo. But Xdebug still was not found in PHPStorm.
HOW TO SOLVE???
PHPStorm was saved the old (my previous) version of PHP. Click on the top menu of PHPStorm: File->Settings->PHP->Interpreter (the button on the right [...])
In the General part you will see the version of PHP.
Click to the refresh button right to the PHP home. Then Click OK, OK.