My scenario:
My local machine is running PHP with Xdebug, along with my IDE. It is accessible from the internet on port 80 and 443.
A remote API is calling the URL I give it.
I want to give the remote API the address of http://myaddr/callback.php?XDEBUG_SESSION=foo and have my local IDE debug this request.
There doesn't seem to be a need to have both the caller and the debug server be the same, but how do I configure this in Xdebug?
Current settings
[xdebug]
xdebug.remote_enable=On
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.idekey=foo
Not sure if this will work, but you could try to remove xdebug.remote_host=localhost and set xdebug.remote_connect_back=1.
(This has security implications, though, because access to XDebug is no longer limited to localhost.)
I found my mistake:
I needed to start the session with XDEBUG_SESSION_START so I have to give the API http://myaddr/callback.php?XDEBUG_SESSION_START=foo
XDEBUG_SESSION is for when the session is already started.
Related
I have a trouble to use debugger in my code, it's my first time to use debugger, I don't know that I am doing it the right way or not, but it is not working for me. it always show this message in variables section...
Waiting for incoming connection with ide key '13001'
I followed this step...
1. my php.ini setting for xdebug
[Xdebug]
zend_extension="D:\XAMMPI\php\ext\php_xdebug-2.4.0-5.6-vc11.dll"
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=80 //i also try the default port (9000) here but it still not working
xdebug.idekey=PHPSTORM
2. I create the configuration setting for Debugger.
3. I apply the break point to code for testing
I am using PhpStorm 2016.1
Any help will be appreciated
UPDATE - 1
Just use my php.ini setting for xdebug
[XDebug]
zend_extension="D:\XAMMPI\php\ext\php_xdebug-2.4.0-5.6-vc11.dll" ; copied this link based on your config.
xdebug.remote_enable=true
xdebug.remote_host=127.0.0.1
xdebug.remote_port=10000
xdebug.remote_autostart=1
xdebug.idekey=
Then install xDebug helper for chrome:
https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc?hl=en
Then change the IDE key to phpstorm
After that, you should create a PHP Remote Debug and not PHP Web Application
Like the picture below.
On your settings. Which can be accessed using Ctrl+Alt S. Search for Debug port, and change it to 10000.
After that you should navigate to your extension in chrome and activate xDebug.
And that's it. Happy Debugging :)
Waiting for incoming connection with ide key '13001'
vs
xdebug.idekey=PHPSTORM
you need to set proper idekey in PHPStorm, and change back ports to 9000. 80 is port for apache (http server), so it will not work as you've configured.
Look here to learn where to set the idekey in ide: https://www.jetbrains.com/help/phpstorm/2016.1/run-debug-configuration-php-remote-debug.html
I've followed multiple tutorials to set up XDebug with PhpStorm but it seems like
I'm not lucky with it at all. No matter what I try, it's always stuck with
Waiting for incoming connection with ide key 'PHPSTORM'
But when I reload the page with CTRL + R I can see for a split second connected.
However, then it switches back to "Waiting.."
I've tried the XDebug Chrome Plugin and the PHPStorm XDebug Generator Bookmarks
aswell as enabling "Start listening for PHP Debug Connections" in PHPStorm.
I'm Using NginX with php5-fpm and tried tcpdump 9089.
As said, for a split second it dumps it. But then it's lost again..
Can someone please help me?
My php.ini config :
[xdebug]
zend_extension="/usr/lib/php5/20121212/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_port=9089
xdebug.remote_connect_back=1
xdebug.profiler_enable=1
xdebug.profilter_output_dir="/tmp/xdebug.log"
xdebug.idekey=PHPSTORM
My PHPStorm Settings :
[
EDIT : I have NO IDEA why, but removing xdebug.remote_connect_back=1
and replacing it with xdebug.remote_host=my.ip.add.ess made it work?!
As I've read the docs I had the understanding that the first setting is for implicit requests
while the later one is for an explicit ip request..
Give the following setting a try, sounds funny but just copy past the entire block instead of typing them in (believe you me that helped a couple of colleague of mine)
xdebug.remote_host=10.0.2.2
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.show_exception_trace=0
xdebug.show_local_vars=0
xdebug.var_display_max_data=10000
xdebug.var_display_max_depth=20
xdebug.max_nesting_level=200
p.s.
I assume you have the extinction file is exists in your guest machine (Virtual Machine) since you said it will stops at the breakpoint for split of sound
Also i assume your browser is sending the correct "PHPSTORM"
I'm trying to debug PHP code with Netbeans 8 (with Java 1.8.0) on a MAMP 3.0.3 (PHP 5.5.10) server, the whole thing running on Mac OS X 10.9.2. But when I launch the debug, Netbeans shows a progress bar saying "Waiting For Connection (netbeans-xdebug)". it never stops, so I suppose it never gets a connection. And of course, the execution of my webapp never stops on my breakpoints.
Here the xdebug configuration in my php.ini:
[xdebug]
zend_extension="/Applications/MAMP/bin/php/php5.5.10/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so"
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_autostart=on
xdebug.idekey="netbeans-xdebug"
xdebug.remote_log="/Applications/MAMP/logs/xdebug_remote.log"
I tried many things found on forums or even here on stackoverflow, but nothing works. Among them: change the port (in the php.ini and the debug conf in Netbeans), change the localhost to 127.0.0.1 or to my real IP, comment out the remote host, check if my timezone was set in the php.ini (it was), load my waebapp with a parameter XDEBUG_SESSION_START=netbeans-xdebug and much more.
Any idea? I'm open to any suggestion, at this point...
Double check your path mapping.
https://blogs.oracle.com/netbeansphp/entry/path_mapping_in_php_debugger
Then download a trial of PHPStorm and see how that works. If it works fine, consider switching to it. Honestly not trying to be smart, I think its a valid solution to this issue.
http://www.jetbrains.com/phpstorm/
http://confluence.jetbrains.com/display/PhpStorm/Zero-configuration+Web+Application+Debugging+with+Xdebug+and+PhpStorm
I added a webroot and an index file in the Netbeans configuration (copying from a colleague's configuration, which is working properly), and now, it works. I won't pretend I really understand why. It seems really fragile, so I won't mess with it just for the sake of understanding...
I am using xampp for php development and eclipse indigo with PDT 3.0 for debugging purpose.
I used curl functions for my web operations wherein i could specify my proxy settings using
curl_setopt($ch, CURLOPT_PROXY, "host:port");
I am trying to use get_meta_tags() of php to fetch all the meta tags but the proxy is refusing connection. I haven't got an idea how to go about this. I have configured XDebug to run without proxy. I simply enabled DBGp Proxy Support and entered the proxy address in the host:port format. I am using the existing IDE Key i.e. ECLIPSE_DBGP in my php.ini file.
When i launch the debug mode it never finishes the launch. It gets stuck at 24%. As soon as i removed disabled DBGp Proxy Support , my debugger launched.
My php.ini config for XDebug looks as follows:
[XDebug]
zend_extension = "E:\others\xampp-win32-1.7.7-VC9\xampp\php\ext\php_xdebug.dll"
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port=9876
xdebug.remote_handler="dbgp"
xdebug.remote_mode="req"
xdebug.idekey = "ECLIPSE_DBGP"
Am i missing anything ? Do i need to specify something more ? In Eclipse or the .ini file ?
Please let me know.
Thanks,
Adithya.
The debug proxy setting is for a specific "xDebug Proxy" program, not a web type proxy to use over the internet.
In order to use it, you will need to set up something like pydbgpproxy
See this link http://derickrethans.nl/debugging-with-multiple-users.html
I found the solution.It looks like port 9000 which is be default used for debugging was in use. I change the port and it worked perfectly.
Following situation:
Windows 7 running on my PC.
Also Eclipse with PDT and VMWare, which is my 'server'.
Within the VM I have Debian 5 running, Apache, PHP + XDebug and OpenSSH-Server.
I can connect to Debian with Putty using the IP 192.168.0.128 and Port 3128.
On my Win7-host there is no PHP available.
How can I get Eclipse to connect with XDebug on the VM?
I'm a bit lost here, 'cause I seem to lack some necessary network-basics. Could someone please give me a hint which 'combination of words' will lead me to the solution using Google, usually that's all you need Google + 'the right words' ... tunneling? remote? ... all lead me astray so far.
Thanks
Raffael
In php.ini on your Debian virtual server, XDebug should have some configuration variables set up. one of them is xdebug.remote_host. It is probably set to "localhost" right now. It needs to point back to your Win7 PC's IP address.
In php.ini (make sure you are editing the one that Apache is using, not the one that PHP CLI is using...they may or may not be the same):
xdebug.remote_enable=on
xdebug.remote_host=192.168.0.999
Where 192.168.0.999 is replaced with the PC's IP address.
You need to make sure that xdebug.remote_port and xdebug.remote_handler are set to the value that your Eclipse plugin is expecting too.
An alternative to specifying an xdebug.remote_host would be to use xdebug.remote_connect_back. I've never set that up, so I can't help you more than point you XDebug's docs.
Note that you may need other php.ini settings to set yourself up properly. I'm not an Eclipse user, so I'm not familiar with its special needs (if any). The XDebug docs or the documentation site for the Eclipse plugin you are using will probably have a basic installation and requirements guide for you.
If you are not sure which php.ini Apache is using, create a php file with phpinfo(); in it (and nothing else, other than <?php to start things out), and then access that file using your browser through the Apache server (drop it in the root directory of the web server). Look for "Loaded Configuration File"... should be near the top.
thanks for the effort.
For the archive, my configurations:
xdebug.ini:
xdebug.remote_autostart = Off
xdebug.remote_enable = On
xdebug.remote_mode=req
xdebug.remote_host=[HIP]
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_log=/var/log/apache2/xdebug_remote
xdebug.profiler_enable = 1
[HIP] you get through netstat, in my case it's the (only) SSH conncetion, b/c of putty.
php.ini:
zend_extension=[path you find in xdebug.ii]
Eclipse:
Debugger: XDebug
Server: IP of VM
That did it for me, basically.
Best
Raffael