This Question is Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
7 Replies Last post: May 19, 2013 5:34 PM by Steel Bull  
John Woodbridge Newbie 4 posts since
Feb 13, 2013
Currently Being Moderated

Feb 13, 2013 6:05 PM

PHPStorm not connecting to xdebug

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

 

Summary

  • Xdebug installed: 2.1.0
  • Server API: Apache 2.0 Handler
  • Windows: no
  • Zend Server: no
  • PHP Version: 5.3.6
  • Zend API nr: 220090626
  • PHP API nr: 20090626
  • Debug Build: no
  • Thread Safe Build: no
  • Configuration File Path: /Applications/MAMP/bin/php/php5.3.6/conf
  • Configuration File: /Library/Application Support/appsolute/MAMP PRO/conf/php.ini
  • Extensions directory: /Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626
  •  

    I am running

    • OSX Mountain Lion
    • PHPStorm 5.0.4
    • MAMP PRO 2.0.5

     

    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.

     

    Thanks

    John

    Andriy Bazanov Master 2,645 posts since
    May 28, 2010
    Currently Being Moderated
    Feb 13, 2013 6:35 PM in response to: John Woodbridge
    Re: PHPStorm not connecting to xdebug

    Hi John,

     

    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):

    Andriy Bazanov Master 2,645 posts since
    May 28, 2010
    Currently Being Moderated
    Feb 13, 2013 8:20 PM in response to: John Woodbridge
    Re: PHPStorm not connecting to xdebug

    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

    Andriy Bazanov Master 2,645 posts since
    May 28, 2010
    Currently Being Moderated
    Feb 13, 2013 9:03 PM in response to: John Woodbridge
    Re: PHPStorm not connecting to xdebug
    Either run the page in Firefox (the page runs and does not stop at the breakpoint)

    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

     

    Or, right click the file in PHPStorm and choose Debug <filename>

    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).

     

    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.

    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.

    Steel Bull Newbie 1 posts since
    May 19, 2013
    Currently Being Moderated
    May 19, 2013 5:34 PM in response to: John Woodbridge
    Re: PHPStorm not connecting to xdebug

    PROBLEM SOLVED!!!!!!!!!!!!

     

    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.

     

    PROBLEM SOLVED!!!!!!!!!!!!

    More Like This

    • Retrieving data ...