i am trying to debug my php code in netbeans. the code runs perfectly but i am unable to debug it(doesn't stop at breakpoint) and the code runs normally.
i have tried every possible workaround in order to get my xdebug working and has been stuck from past few days.. anyone out there who can help me sort out this issue.
xdebug configuration in .ini file:
zend_extension = /usr/lib/php5/20090626/xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=mgiplocalhost
xdebug.remote_port=9000
here mgiplocalhost is my virtual host.
i have tried with other possibilities as well like localhost and ip address but the waiting for connection still exists.
In netbeans->tools->options->debugging when i set my port as 9000 and debug it asks me to change the port since port 9000 is already in use. i have changing the port but the problem persist.
please i need help to sort it out asap. please help me out.
A bit late but thought this should have an answer! To get Xdebug working, the minimal configuration I found I needed in the php.ini file was the line to load the extension:
zend_extension=php_xdebug.dll (pointing to the downloaded dll from the Xdebug site)
And the following Xdebug settings also placed further down in the php.ini file:
[Xdebug]
xdebug.remote_autostart=On
xdebug.remote_enable=On
xdebug.idekey="netbeans-xdebug"
The Xdebug default port was 9000, and that is also what Netbeans was using (Tools -> Options... -> PHP -> Debugging.) If 9000 is in use, you could also set that in Netbeans to be 9001 and in the php.ini file add the line xdebug.remote_port=9001 with your other xdebug settings.
Then try it out after restarting the server.
Related
I'm using PHPStorm and Xdebug. I'm trying to debug a Web Application Project configured in my localhost. There are no symbolic links in my project path.
Below is Xdebug configuration in my php.ini:
[Xdebug]
xdebug.remote_port=9000
xdebug.remote_enable = 1
xdebug.remote_autostart = 1
xdebug.profiler_enable=1
xdebug.remote_host=localhost
xdebug.remote_handler=dbgp
xdebug.idekey = "PHPSTORM"
xdebug.profiler_output_dir="/tmp"
xdebug.remote_log="/tmp/xdebug.log"
zend_extension=/usr/local/php5/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
Below are two variables exported in my zsh:
export PHP_IDE_CONFIG="serverName=localhost"
export XDEBUG_CONFIG="idekey=PHPSTORM"
Below is server configuration:
Below is debug configuration:
Below is the screenshot of first breakpoint where I see no variable values.
Below is the screenshot after 'Step In'. It shows: Waiting for incoming connection with ide key 'PHPSTORM'.
I get below message in event log:
Debug session was finished without being paused.
It may be caused by path mappings misconfiguration or not synchronized local and remote projects.
To figure out the problem check path mappings configuration for 'dev.sales-crm.com' server at PHP|Servers or enable Break at first line in PHP scripts option (from Run menu).
My problem is: after debugging is started, then control stops at first breakpoint. It shows no variables values. Then If I try to 'step into', then debugging stops.
Please help me. Below is the link to xdebug logs: xdebug.log
I upgraded my Xdebug version form Xdebug 2.5.0rc1 to Xdebug v2.5.0 and it started working.
Thank you very much.
I am literally freaking out because of this.
I tried every possible setting, but I can't get this to work.
I tried with 4 different Firefox extensions and with Google Chrome. Xdebug won't work, my PhpStorm Debugger window keeps saying:
waiting for incoming connection with ide key 'xxxxx'
(xxxxx is a random number, it changes with every debug, the last was 10131)
My php.ini located in C:\xampp\php\php.ini
[Xdebug]
zend_extension = C:\xampp\php\ext\php_xdebug-2.4.0-5.6-vc11.dll
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.idekey='phpstorm'
xdebug.profiler_enable=1
xdebug.profiler_enable_trigger=1
xdebug.profiler_enable_trigger_value=1
xdebug.trace_enable_trigger=1
xdebug.trace_enable_trigger_value=1
xdebug.remote_log=c:/xampp/tmp/xdebug/xdebug_remote.log
I tried changing the port number from 9000 to 9001 for example, no chance.
No xdebug log file is created at all.
PhpStorm Settings:
I tried different configurations, too, but no chance. Please help me.
Netbeans won't connect to xdebug. I've tried suggestions from the following posts:
Debugging IDE's port connection to XDebug: "Waiting to Connect"
netbeans shows "Waiting For Connection (netbeans-xdebug)"
but it doesn't fix my issue.
It seems Netbeans connects to xdebug because while it waits for the connection all request made to the webserver [Apache2] are blocked. Also the port [9001] appears to be in use:
roxy#Pixy011 ~ $ sudo nmap -sS -O 127.0.0.1
Starting Nmap 6.00 ( http://nmap.org ) at 2013-11-28 20:48 EST
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000029s latency).
Not shown: 990 closed ports
PORT STATE SERVICE
22/tcp open ssh
139/tcp open netbios-ssn
443/tcp open https
445/tcp open microsoft-ds
631/tcp open ipp
902/tcp open iss-realsecure
3306/tcp open mysql
8080/tcp open http-proxy
8081/tcp open blackice-icecap
9001/tcp open tor-orport <---- Opened by java
xdebug.ini: [I have confirmed it is loaded in phpinfo()]
zend_extension=/usr/lib/php5/20100525/xdebug.so
xdebug.remote_autostart=1
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_mode="req"
xdebug.remote_host="127.0.0.1"
xdebug.remote_port=9001
xdebug.idekey="netbeans-xdebug"
Netbeans configuration:
Debugger port: 9001
Session ID: netbeans-xdebug
Stop at first line: Checked
All other options are unchecked
Project properties:
Host: 127.0.0.1
Port: 9001
Edit:
I've noticed Netbeans doesn't append the XDEBUG_SESSION_STOP to the URL. I don't think this is related to the issue because Netbeans only opens the page after I close the debugging session.
I've also disabled SELinux
On Ubuntu 13.04 64bit php 5.4.9-4 Xdebug v2.2.3 netbeans 7.4
I have same problem and have solve it by:
1. go on http://xdebug.org/wizard.php follow the instructions to compile your own xdebug.so
2. in netbean 7.4 general options (sorry I haven't reputation 10 to post image)
test connection. be sure correct settings on Proxy:
to me "No Proxy" is working.
3. in php options debugging tab change xdebug setting port to other than 9001 or 9000.
I choose 9002 but you can try until you find a free port (if port is not free nb tell you)
4. in php.ini OR for ubuntu users in /etc/php5/conf.d/20-xdebug.ini
zend_extension=/usr/lib/php5/20100525/xdebug.so #where you ave put your reconpiled xdebug.so
[xdebug]
xdebug.remote_autostart=0
xdebug.remote_enable=1
xdebug.remote_handler="dbgp"
xdebug.remote_mode="req"
xdebug.remote_port=9002 # the port you have found free and set in netbeans above
xdebug.remote_host=127.0.0.1
xdebug.profiler_enable=0
xdebug.profiler_output_dir="/tmp/"
xdebug.idekey="netbeans-xdebug"
xdebug.remote_log="/home/#user_name#/xdebug.log" #your user name
5. sudo service apache2 restart
after do this I can debug php again.
I had the same issue and I have tried many solution i had found out there but the issue still occured. I have tried to follow the step discribe in enter link description here
and
enter link description here
And that , whttp://localhost/abc/trunk/abc/backend/web/?XDEBUG_SESSION_START=netbeans-xdebughen i debug my project, my netbeats still waiting connection till i have to had the following "?XDEBUG_SESSION_START=netbeans-xdebug" in my url as http://localhost/abc/trunk/abc/backend/web/?XDEBUG_SESSION_START=netbeans-xdebug
so netbeans was able to connect with xdebug
**On Windows 10 with Netbeans 8.0 running Netbeans built in webserver **
The following options in the php.ini file resolved the issue for me:
zend_extension ='C:\path to php installation\ext\php_xdebug-2.5.0-5.6-vc11.dll'
xdebug.remote_enable=on
This issue for me seemed to be resolved by using the full path to the .dll file. Also, because I had spaces in the path name I had to enclose the path in quotes (double vs single did not seem to matter). Also, I had to set the xdebug.remote_enable option. Once I set both options, I was able to select the Debug Application option within Netbeans and the debugger started.
i was facing a similar problem, in my case i had recently update my php version and the xdebug configuration were in the only php5 folder. had simply had to copy the old xdebug configuration to the new php.ini file of the new version and it worked like before.
some of the tips to debug this are:
first check if xdebug is install, run (php -v) if xdebug details aren't there then install and add the configuration.
open phpinfo() under xdebug category check if xdebug configuration is loaded.Check for the following settings.
remote_enable = on,remote_handler=dbgp
I faced the same issue to get xdebug worked in virtualbox ubuntu machine with Netbeans.
PHP version 7.4
Changed following file
"/etc/php/7.4/apache2/conf.d/20-xdebug.ini"
and added following lines
zend_extension="/usr/lib/php/20190902/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_log = "/var/log/xdebug.log"
Plese note that the line below consists double quotes for defining the path.
zend_extension="/usr/lib/php/20190902/xdebug.so"
Had same issue:
$ netstat | grep 9000
...
tcp6 1 0 localhost:9000 localhost:37486 CLOSE_WAIT
Solution: Restart NetBeans.
There was running a dead Process waiting for connections.
Here Netbeans with a running debug session. Note the CLOSE_WAIT and TIME_WAIT.
tcp6 0 0 localhost:9000 localhost:38166 TIME_WAIT
For Xdebug v>=3
If you are still facing issues after trying all above answers. And you have Xdebug version >=3 then only try my steps.
Some settings have been changed in v3.
Xdebug's default debugging port has changed from 9000 to 9003. So change it in php.ini and netbeans IDE.
In php.ini
add xdebug.start_with_request="yes"
add xdebug.client_host = localhost . (The old xdebug.remote_host=localhost is no longer useful in v3)
add xdebug.mode=debug
I use PHPStorm along with Xdebug to step through my code. PHPStorm is running on a Windows 7 machine, and my local webserver is running on a separate CentOS 6.4 machine. I've done a phpinfo(); to verify that Xdebug is being loaded by PHP, and it is. The following are the settings for my Xdebug in the PHP.ini:
[xdebug]
zend_extension="/usr/lib/php/modules/xdebug.so"
xdebug.remote_enable = 1
xdebug.remote_port = 9000
xdebug.remote_host = "192.168.1.130"
xdebug.remote_log = "/var/log/httpd/xdebug_log"
I similarly setup PHPStorm to use my CentOS server as the debugging server, and I listen for connections. I assigned static IPs to both of these machines. Using a Chrome Xdebug plugin to set the appropriate cookies, I attempt to set a breakpoint, but nothing happens. When I go to look in /var/log/httpd/xdebug_log (which has 777 permissions), nothing is written there. I've opened up port 9000, and I can telnet from my CentOS machine back to my Windows machine on port 9000 no problem. I also set SELinux to permissive, but to no avail.
Any ideas what could be happening here?
Try to configure your project in PhpStorm
Open Settings->Languages & Frameworks->PHP->Debug
Uncheck the "Ignore external connections through unregistered server configurations" option
OK
Add to your php.ini:
xdebug.mode=debug
I was having the same issue, below are the steps I performed to resolve it:
Make sure you have xdebug installed and in php.ini uncomment xdebug.mode=debug
Open Settings->Languages & Frameworks->PHP->Debug, Assign Debug Port value, you can find this port from php.ini. In my case, it was 9002
Now Validate debugger configurations - here you need to add the path to your web application files and URL. Click validate.
Now Start Listening -> Enable listening for PHP Debug Connection.
After this setup you can set a break point and start debugging with XDEBUG.
In my case, i added folder that im debugging to exclusive, so it return 502 or blank page when i put breakpoint. Remove exclusive folder and everything working.
You can consider this blog to find more solution: Link.
sudo gedit /etc/php/7.2/mods-available/xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable = 1
xdebug.remote_port = 9898
xdebug.idekey = “PHPSTORM”
xdebug.show_error_trace = 1
xdebug.remote_autostart = 0
xdebug.mode=debug
xdebug.client_port=9898
I have used XDebug semi-sucessfully with PhpStorm and Mamp, but now I want to try using NetBeans for a project. But I can't get NetBeans to connect to XDebug. It just waits until I stop the debugger and then I get a message that NetBeans never got a connection to XDebug, and it asks me to check the settings in php.ini.
Now, as I said it has worked ok with PhpStorm, so I don't think there should be anything wrong with the settings in php.ini, but anyway, here they are:
[xdebug]
zend_extension="/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
One thing that I found strange was that everyone talks about php.ini being located in /Applications/Mamp/conf, but in that folder there is no php.ini in my setup at least. In /Applications/Mamp/bin/php/php5.3.6/conf on the other hand, there is. So that's the one I have modified. And since it works in PhpStorm I figure it must be right...
But then, why isn't NetBeans able to connect? I'm also using the XDebug plugin for Safari to hook it up in the browser. And the port in NetBeans is set to 9000 as in the php.ini file.
I'm using NetBeans 7.0.1 and php5.3.6.
Anything else I'm missing?
EDIT:
Well, I found the problem for why XDebug wasn't connecting anyway: I am using the add-in for Safari for XDebug, and apparently it had it's own setting for IDE Key, set to 1, while NetBeans had netbeans-xdebug set. Once I changed it to the latter in the add-in I got a connection. The problem is I still get some sort of error. It says: 404 Page not found when I hit the debugger, and the address in the address field is: http://localhost/app_netbeans/index.php?XDEBUG_SESSION_START=netbeans-xdebug
Any idea what is going on here?
BTW, just hitting run inside NetBeans works fine and opens http://localhost/app_netbeans (I have used mod_rewrite to remove the index.php part of urls in CodeIgniter)
EDIT 2:
I found that the index.php part of the address was because in the run configuration in NetBeans there was an "index file" setting that was set by default to index.php. If I removed that to have CodeIgniter "controller" urls without the index.php I got the correct url, but with the xdebu stuff appended after it. But still I get the 404 Page not found when I use the debugger command, but not when I use the run command.
Weirdly enough what I can do is I can hit debug, ignore the fact that it goes to 404 Page not found, and go back to the IDE, hit run and if I have a breakpoint set it will then stop at that breakpoint.
But again, this is not exactly what I would consider normal debugging behaviour... So if anyone knows what is going on I would love to hear it...
Use this config and make sure you update Netbeans to use port 9001.
[xdebug]
zend_extension="/Applications/MAMP/bin/php/php5.3.6/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.remote_host=localhost
xdebug.remote_port=9001
xdebug.remote_enable=1
xdebug.idekey="netbeans-xdebug"
I found that the port 9000 sometimes conflicts with other applications, and xdebug seems to fail silently if it cant use it.
use the following code..
zend_extension="path to the xdebug.so"
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;
[xdebug]
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
and also make sure the port in the netbeans is correct. you can check that in
goto tools menu and select options
in options click on the php and check the port number.
Mine is finally working, so I wanted to post my full php.ini configuration:
[xdebug]
; got this script from https://netbeans.org/kb/docs/php/configure-php-environment-mac-os.html
xdebug.default_enable=1
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9001
xdebug.remote_autostart=1
xdebug.idekey="netbeans-xdebug"
zend_extension="/Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/xdebug.so"
xdebug.remote_log="/Applications/MAMP/logs/xdebug_remote.log"
You may also check if your project is configured to copy to a different directory in the Netbeans project settings. After I changed this setting I had to restart Netbeans and MAMP using the quit command.
Just to note:
No index.php in my start up properties
Stop at first line is turned off in debugging preferences
I do think changing to port 9001 made a difference on my system