How to make work xdebug with PHPStorm 2.1 using wamp

Hello, I'm Andrea from Italy. Usually I'm a java programmer but now I'm starting to learn PHP to improve my business. I'm using PHPStorm in a windows 7 ultimate 64 bit machine with installed Wamp server.

I'm not able to use the xdebugger at all (of course it's my fault but I cannot figure it out).... these are my php.ini settings for xdebugger:

; XDEBUG EXTENSION
zend_extension = c:\wamp\bin\php\php5.3.4\ext\php_xdebug-2.1.1-5.3-vc9-x86_64.dll

[xdebug]
xdebug.remote_enable = on
xdebug.remote_handler = dbgp
xdebug.remote_host = localhost
xdebug.remote_port = 9000
xdebug.remote_mode = req
xdebug.profiler_enable = on
xdebug.profiler_enable_trigger = on
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"

When I try to run debug from the "Run" menu nothing happens and in the debugger console it appears (in the left window) the message:

"Unable to attach test reporter to test framework"

and in the right window it appears:

C:\wamp\bin\php\php5.3.4\php.exe "C:\Users\The DragonLord\AppData\Local\Temp\phpunit_ProvaPHP_The_DragonLord.php" d C:\wamp\www\ProvaPHP
Testing started at 11.17 ...
PHPUnit is missing from include paths.
Please adjust ''include_path'' variable in your ''php.ini'' configuration file.
Process finished with exit code 0

And in the lower lest corner of the IDE it appears a ballon message that tells: Debug connection with XDebug was not established

This IDE is a lot different from Eclipse (wich I use to develop java code) and I cannot configure it properly.

What I did wrong (or missed)?

Thanks and regards
Andrea

5 comments
Comment actions Permalink

Hi Andrea,

So .. what are you trying to debug/run -- "normal" script or PHPUnit tests? The error message you have provided is referring to PHPUnit not xdebug.

Let's do it one-by-one:

1) If you execute such file (below) in your browser -- do you see any references to xdebug (to make sure is installed properly and enabled)?

<?php
    phpinfo();
?>

2) Regarding that PHPUnit message.

C:\wamp\bin\php\php5.3.4\php.exe "C:\Users\The DragonLord\AppData\Local\Temp\phpunit_ProvaPHP_The_DragonLord.php" d C:\wamp\www\ProvaPHP
Testing started at 11.17 ...
PHPUnit is missing from include paths.
Please adjust ''include_path'' variable in your ''php.ini'' configuration file.

You need to do as suggested -- you need to add the path to PHPUnit files into ''include_path'' variable in your ''php.ini'' configuration file (which likely to be located here: C:\wamp\bin\php\php5.3.4\php.ini ).

How did you installed PHPUnit -- via PEAR or manually or maybe it come together with wamp?
If via PEAR -- then add path to the PEAR folder to the above mentioned variable -- based on your php.exe path it may look like this:

include_path = ".;C:\wamp\bin\php\php5.3.4\PEAR"

If other way -- add the appropriate path.

0
Comment actions Permalink

Please also consider reading these manuals (if you have not done it already):
http://confluence.jetbrains.net/display/WI/Documentation

Another usefull link (bookmarklets to control Zend Debugger/Xdebug from browser)
http://www.jetbrains.com/phpstorm/marklets/

0
Comment actions Permalink

Hi Andriy. What I'm trying to do is debug the php code imbedded in my test web pages (or contained in some .php files"loaded" by web pages). I've already red the online manual you've reffered but notning works...

My first question is: can I debug a "web page" (the embedded php code, of course) directely from PHPStorm? Does it start automatically the browser or not ot Should I access my web page from firefox/IE and the debug should start in PHPStorm?

in phpinfo i don't see anithing about xdebuggerregardless of mi php.ini....I'm afraid that this could be the problem. Using the popup menu from the wamb icon in the taskbar I can see that the extension php_xdebug-2.1.1-5.3-vc9-x86_64 is not checked and if I manually check it the server restart but the extension keeps on be unchecked....

0
Comment actions Permalink

Well, that most likely means that you have wrong xdebug build. By looking at xdebug extension filename .. it appears to be 64-bit. I think your php installation is 32-bit and therefore you need 32-bit xdebug as well.

Please download another xdebug build and try again: http://xdebug.org/download.php

My first question is: can I debug a "web page" (the embedded php code, of course) directely from PHPStorm? Does it start automatically the browser or not ot Should I access my web page from firefox/IE and the debug should start in PHPStorm?

Both scenarios are supported.

0
Comment actions Permalink

Hi Andrea,

Do you still have any issue with xdebug?

Thank you for feedback!

0

Please sign in to leave a comment.