Useful informations:
Ubuntu 19.04 x86_64
PHP 7.2
Xampp for linux 7.3.4
Netbeans 8.2
Xdebug 2.7.1
I installed with success PHP-cli, netbeans and xampp for linux on my brand new Ubuntu 19.04 installation.
After that I uploaded my /opt/lampp/etc/php.ini file on https://xdebug.org/wizard.php and I followed scrupulously the instructions.
I copied the generated xdebug.so in /opt/lampp/lib/php/extensions/no-debug-non-zts-20180731 and then I edited the /opt/lampp/etc/php.ini adding those lines:
[xdebug]
zend_extension = /opt/lampp/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so
xdebug.remote_autostart = 1
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
xdebug.remote_log = /tmp/xdebug_remote.log
xdebug.remote_mode = req
xdebug.remote_port = 9000
I went to http://localhost/dashboard/phpinfo.php , here I can see the Zend Engine logo but in the "configuration" section there isn't any xdebug section.
In my local terminal i executed those commands php -m and php -v. The first returned a list of modules among which xdebug was not included, the second returned a the php version and, again, xdebug was not included.
After this I decided to add the [xdebug] section also in the /etc/php/7.2/cli/php.ini and then the php -m and php -v commands have returned xdebug in loaded modules and in the version list.
Anyway the http://localhost/dashboard/phpinfo.php refuses to list xdebug among the active modules and if I try to start a debug session netbeans hangs-on "waiting for connection xdebug".
I checked two, three, four.... times the zend_extension path and is corrected
I restarted multiple times lampp, apache, netbeans and the pc
I tried multiple ports 9000, 9001, 9002 ....
The php and xdebug versions are compatible
Here are some similar problems: xdebug in phpinfo() is not showing , No xdebug in phpinfo() , Xdebug installed but does not display in Phpinfo for Xampp .
Obviously, when I could, I tried these solutions, but without success.
I'm trying to install Xdebug and PhpStorm as per the following:
I have an iMac that I work form where I just write the PHP scripts.
I have an Ubuntu 14.04 Server which runs the PHP scripts that I upload to it.
I want to install Xdebug on the Ubuntu Server machine but still use my iMac for writing the scripts, I want to be able to debug my code with Xdebug/PhpStorm from my iMac on my Ubuntu Server.
I have followed several guides and have installed Xdebug properly, sudo apt-get install php5-xdebug. I have also edited the php.ini file so that the following text appears in my phpinfo file: "with Xdebug v2.2.3". I added the following lines to my php.ini file:
zend_extension=/usr/lib/php5/20121212/xdebug.so
xdebug.default_enable=1
xdebug.idekey=PHPSTORM
xdebug.remote_enable=1
xdebug.remote_autostart=0
xdebug.remote_port=9000
xdebug.remote_connect_back=1
Then I installed PhpStorm 2017.2 on my iMac. But from here I can't get anything to work.
How do I configure PhpStorm to be able to debug the code that's on my Ubuntu Server? I have SSH on my Ubuntu Server and can connect to my Ubuntu Server with SSH.
I'm on Windows and I'm trying to debug a Web application (hosted with Vagrant/Homestead) using PhpStorm through XDebug. I tried many configurations but I can't get things working. The PhpStorm XDebug setup is pretty common.
This is the current xdebug configuration:
vagrant#homestead: /etc/php/7.0/cli/conf.d/20-xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable = on
xdebug.remote_connect_back = on
xdebug.idekey='PHPSTORM'
In the IDE "Start listening for PHP debug connections" it's turned on. When I attempt to start debugging a new chrome tab opens and the URL ends, for example, with ?XDEBUG_SESSION_START=16588 but the debugger doesn't run and this is what the IDE says:
Also, netstat says the port 9000 is still listening.
Any idea?
You are changing the 20-xdebug.ini file for the Command Line Interface (CLI). Instead you need to change the /etc/php/7.0/apache2/conf.d/20-xdebug.ini for the Apache settings, since you are using Chrome.
UPDATE
I'm not sure of the differences between Apache and Nginx (which may be /etc/php/7.0/fpm/conf.d/20-xdebug.ini), but here is how I got it working with a VirtualBox VM running Apache, on a Windows computer.
Settings for 20-xdebug.ini:
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=192.168.1... (your windows IP address within your network)
xdebug.remote_port=9000
xdebug.autostart=1
I have Xdebug running as part of PHP5.6 installed on OSX with Homebrew. I can run PHP-FPM and serve my site fine, however debugging using X-debug does not seem to work.
Here is my ext-xdebug.ini
[xdebug]
zend_extension="/usr/local/opt/php56-xdebug/xdebug.so"
xdebug.remote_enable = On
xdebug.remote_port="9000"
xdebug.profiler_enable=1
xdebug.profiler_output_dir="/tmp"
xdebug.idekey=PHPSTORM
php-fpm usually runs on port 9000.
This is also the default port for xdebug.
Adjust your xdebug setting in php-fpm to use port 9001
If you used brew to install, they are found here:
/usr/local/etc/php/5.6/conf.d/ext-xdebug.ini
Add the following to your ext-xdebug.ini
[xdebug]
zend_extension="/usr/local/opt/php56-xdebug/xdebug.so"
xdebug.remote_enable=On
xdebug.remote_connect_back=On
xdebug.remote_port=9001
Docs for those xdebug settings.
Adjust phpStorm to use port 9001 for debugging.
It's found under preferences -> language & frameworks -> php debug.
Just for completeness, here's my Caddyfile
:80
log ./caddy.log
root ./html
fastcgi / 127.0.0.1:9000 php {
env WHEREAMI dev
}
rewrite {
if {path} not_match ^\/wp-admin
to {path} {path}/ /index.php?_url={uri}
}
Restart Caddy, php-fpm and phpstorm and you should be good do go.
I'm trying to use XDebug in the following scenario
Physical Host on Windows 7, with Netbeans 7.1.1
Virtual guest on Ubuntu, with Apache server and PHP 5.3.10
the PHP code of my website is on a shared folder on Ubuntu, in /var/www/mysite
the PHP code is accessible from my Windows host, on \\guestIP\mysite, with R/W permissions
Website accessible from http://mysite.local.fr, from both host and guest
I created a Netbeans project from my Windows Host, pointing to \\guestIP\mysite.
In the project Run configuration, I have the following:
Run as: Local web server
Project URL: http://mysite.local.fr
Index file: index.php (does exist in the project)
In the Advanced Run Configuration:
I checked "Ask every time" (I also tried using "Do not ask" and starting the browser with the session key myself)
I tried setting '/var/www/mysite' - \\GuestIP\mysite for the mapping (and tried using nothing as well)
I haven't touched the proxy settings
I have the following in the php.ini on my Ubuntu VM
xdebug.remote_enable = on
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = /tmp
;xdebug.remote_host=localhost,<HostIP>, mysite.local.fr
xdebug.remote_connect_back=1
xdebug.remote_handler=dbgp
xdebug.idekey="netbeans-xdebug"
xdebug.remote_mode=req
None of this works, Netbeans does not stop at any breakpoint from Windows.
Debugging directly from my VM with Netbeans works fine.
Can someone tell me how to get my debugger to work remotely from Windows?
Thanks
Sorry, i can't comment anymore. #David #JamesB41: I've been looking for this too. My setup is a Windows 7 host with NetBeans 7.1, and an Ubuntu VM in VirtualBox. I have the NetBeans project set up as a remote project, uploading and downloading using SFTP.
The following setup works for me, just use your host's IP as remote_host, and make sure the VM can see it.
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=10.217.165.193
xdebug.remote_port=9000
xdebug.remote_log="/tmp/log/xdebug.log"
NetBeans will stop at the entry point breakpoint (if you have the option set in PHP->Debugging). But, it won't stop on NetBeans-created breakpoints, because its running off the VM's files. You can use xdebug_break() though, and it will show stack and variables. It will stop at NetBeans breakpoints and highlight if you map the folders correctly in project config > Run Config > Advanced. Awesome. I am complete.
(The connect_back config didn't seem to help, possibly because $_SERVER['REMOTE_ADDR'] isn't populated.)
Go through the below document for remote debugging using NetBeans. Very helpful.
http://stuporglue.org/setting-up-xdebug-with-netbeans-on-windows-with-a-remote-apache-server/
In know this is old but a good reminder. Make sure if you are using nat in virtualbox that you set port forwarding on the xdebug port back to the local machine typically 9000 by default.
Another option is to have the VM configured to speak to its own localhost:9000 (default for xdebug) and then ssh in from host to VM and establish a port tunnel for that port back to the host machine. Then your host machine debugger simply connects to localhost:9000 and everything should work exactly as if they were running on the same machine.
See: Multiple users XDebug and PHP Debugging
Debugging remotely with Linux + Apache + PHP + xdebug + NetBeans (SFTP)
I've got the following setup and it works.
Host PC (client)
Linux Debian Jessie **
NetBeans version 8.0.2
NetBeans has a project created as "PHP Application from Remote
Server", that has to be debugged
NetBeans connects to Remote Server using SFTP
IP (for example): 192.168.0.2
** I am aware that the OP question mentions Windows, but regarding that the main setup to solve this should be made on the VM, I hope this helps somebody anyway.
Guest PC (server) / Virtual Machine
Linux Debian Jessie
Apache
PHP 5.6
xdebug 2.2.5
IP (for example): 192.168.0.1
The following steps should be made on the "Guest PC (server) / Virtual Machine"
install xdebug sudo apt-get install php5-xdebug
edit /etc/php5/apache2/php.ini,
add these lines right before the [Date] AND change xdebug.remote_host to reflect your "Host PC (client)" IP:
[debug]
; Remote settings
xdebug.remote_autostart=off
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=192.168.0.2
xdebug.remote_port=9000
restart apache sudo service apache2 restart
Reference
How to configure XDebug - Remote Debuging http://wiki.netbeans.org/HowToConfigureXDebug#Remote_Debuging
you need to have correctly configured property xdebug_remote.host on
remote machine. The IP address of local machine has to be defined in
this property. For example, you want to debug your source code on
remote machine 192.168.0.1 using Netbeans installed on 192.168.0.2.
You need to change xdebug.remote_host on 192.168.0.1 to
xdebug.remote_host=192.168.0.2. If doesn't work verify you have port
configured in xdebug.remote_port open on both machines.
If all seems to be correct but you still get "Waiting For Connection" from inside netbeans you should try in your php.ini settings
xdebug.remote_connect_back=on
as it allows connection from ANY ip or look at a lot more info on the issue http://www.devside.net/wamp-server/netbeans-waiting-for-connection-netbeans-xdebug-issue