Remote PHP Debugging with Netbeans and XDebug (remote server) - xdebug

I've seen all other topics on this subject and incorporated all recommendations, but still it doesn't work.
I'm trying to debug my NetBeans project using xDebug that I've installed on remote server. I have all required settings configured properly but still can't get xDebug to stop at a breakpoint (information from phpinfo()):
xdebug.remote_enable On
xdebug.remote_handler dbgp
xdebug.remote_host 62.216.43.2
xdebug.remote_port 9000
xdebug.remote_connect_back On
The ports are equal both on remote server and in Netbeans - 9000.
I've checked "break at first line" flag and made sure that xdebug.idekey is netbeans-xdebug in phpinfo(). After I run debugger it opens the following:
after run the debugger will open this url
http://my.ip.address.here/inreado.com/?XDEBUG_SESSION_START=netbeans-xdebug
The project is set up to run as http://my.ip.address.here/inreado.com.
I presume that the problem could be with remote_host setting or project URL:
My IP address inside local area network is 192.168.0.188, where and my external IP is 62.216.43.2. Either of them as remote_host value yields no result.
Or maybe the problem is with the URL as it's not proper DNS name.
Thanks for any help in advance!

Remember you need to set the Path Mapping in the Debugger tab inside Netbeans Options.
Another little big problem I was having when trying to connect from NetBeans remotely was the SSH tunnel. You have to creat it for the port xdebug will work on, 9000 usually.
If you experience network problems for a moment, the tunnel might "break" silently and NetBeans will be stuck in the holy "Waiting for connection..." state. In putty, you can right click and Restart Session, but this won't work.
You will need to close the putty window and re open the session for it to work again.
Hope it helps!

Related

Citrix remote desktop not working on new computer

I got a new computer at work and I need to work remotely using citrix receiver. It works on my old computer. I download a .ica, launch it, and a remote desktop opens where I can work. The old computer had windows 7.
On the new computer, I installed the last version of citrix and tried, but it doesnt work. I dont get any error, it actually seems to work, but needs like 1 minute to detect my mouseclicks, until it finally disconnects. The new computer has windows 10.
I tried to uninstall the lastest version of citrix receiver, and install the same I have on the old computer (4.6) but the same happens.
So, the problem is it works VERY slow (1 minute to detect each click) and then before I even log into the remote machine, it just disconnects.
Im using the same network and citrix receiver version than in my old computer. Any idea if it can be windows 10 related or how can I find out what it is causing it?
Maybe this info can help: Ive noticed a difference when opening the network central. On my old computer (where it works) I see: Terminal Server - Citrix receiver. And at the bottom it says: 1 server 0 remote applications
On the new computer (doesnt work) it says: MAD-BDCOT-PS-02 - Remote Desktop Connection. And at the bottom: 1 server 1 remote application
That's the only difference I see, but Ive done the same in both cases.
Thanks
Made it work.
After trying many things for 2 days, even installing almost every citrix receiver version, a coworker gave me a file called CitrixOnlinePluginWeb, Instead of CitrixReceiver.
I dont know what it is, and I cant post a link since he gave it to me, but Im sure knowing the name makes it easy to find in google. With this, it worked.
By the way, I think the problem was windows 10, since before knowing this other installable, I tried in several computers, and it always worked on win7 ones and didnt on win10 ones.

Launch PostgreSQL GUI

I have installed PostgreSQL v9.6 on Windows 7 using my user (PC-Admin), the problem is when I start Pgadmin4.exe the application shows that it is starting then freeze without showing the GUI , taking the following notes into consideration:
it is working fine for other users on the PC even if not in admin group.
I tried to uninstall it , delete registry folders for local machine & local user and also delete the temp folder and Apps roaming , also the folder of the program in c:/ drive and then re-install it again and problem has not been solved.
I believe that something went wrong during first time installation for my user
but I could not figure it out.
Please help me, what to do in order to clear my installation profile and then having the GUI launched after short while from starting the Pgadmin4.exe
Regards
Solved and GUI started ! just by disconnecting PC from internet before opening the application.
pgAdmin4 hosts desktop application on 127.0.0.1:(Random_Port) when started, So if you have proxy setup then upgrade to pgAdmin4 version1.6, It has resolved the this proxy related issue. (Link)

Xdebug connects to IDE when it shouldn't

I have remote_autostart disabled and no cookie present:
Still, Xdebug is connecting to my IDE (PhpStorm) at 192.168.22.101:9000 and zero-config debugging works. Why? How do I disable it? (It looks like autostart is somehow enabled and the PHP app is slow.)
My first bet would be that this is not the php.ini you're looking for. If you have CLI and normal php.ini, make sure you have this set up in both. Integrated PHP server counter-intuitively uses web php.ini instead of CLI one.
Next step would be to check whether it's actually xdebug that's causing the issue. I'd do that by disabling the extension alltogether.
Note that xdebug can slow down you app in some cases no matter what just by being enabled.
Next I'd check that xdebug profiler information is not generated. If the app is slow in general it's the profiler. If it just hangs for few seconds and then runs normally it's waiting for remote debugger. Might be a good idea to measure (even by simple means like putting dump on first and last line of code) speed of the app to rule out this possibility.
I have been having exactly the same issue for a few days now. remote_autostart is set to off but it still triggers even on my own <?php phpinfo(); script. The debugging session even starts when using an incognito browser session.
Notice the odd IDE key btw, it is set automatically.
Update: Even with xdebug.default_enable on off, it still activates Xdebug in my IDE.

Xdebug remote debugging

I have been trying very hard to get xdebug working. Tens of hours have been spent but still not making much progress. I think that is because there are some basic concepts being not very clear to me. One of them is "remote debugging".
Let's say I have a remote php file in VPS, if I download it and xdebug it, how does the IDE know the local file is a copy of the remote one? Can someone describe what happens when xdebugging?
What I guess is: after setting the remote port in IDE and setting browser, when I open the PHP file in the browser, when a breakpoint is reached, the IDE will establish some connection with the server and display the remote file's content in the editor. Now I can watch variables, step running functions etc, and any change I make to the file will be saved to the remote server. Is this understanding correct?
when I open the PHP file in the browser, when a breakpoint is reached, the IDE will establish some connection with the server and display the remote file's content in the editor
That is not correct. The IDE does not establish the connection, but Xdebug/PHP does. The IDE acts like a server and listens for incoming debugging connections.
You don't mention which IDE you use, but most of them will allow you to setup a "path" mapping. Such a mapping tells the IDE how to map remote paths (the ones that PHP and Xdebug see), to the ones on your local system (the ones your IDE sees).
PHP Storm should ask you for a mapping if it can't find a file for example, but otherwise you can configure them yourself in File -> Settings -> Build, Execution, Deployment -> Deployment and then the "Mappings" tab.
Other IDEs do it in other ways, but all IDEs (except Komodo) need to have the files locally available. Please note that the protocol does support only having the files remotely, but only the Komodo editor knows how to deal with that. PHP Storm does not yet.

PHPStorm has no PHP intepreters being listed

I used to be able to run X-debug (I think on PHPStorm 5) - now several months later I'm trying to debug again and have run into an issue where I need to set my Interpreter in order to start debugging.
I develop on a remote host (via Samba) so there is no PHP executable to map a path to. Should I be seeing something in the dropdown list, as per this screenshot?
What do I need to do in order to see a PHP 5.x interpreter appearing?
You don't need to configure the interpreter if you are not debugging local PHP scripts and not trying to use PHP provided web server. When debugging remote sites, xdebug running on the server connects back to PhpStorm.
What do I need to do in order to see a PHP 5.x interpreter appearing?
You need PHP installed locally on your machine where PhpStorm is running and specifying the path to php.exe in the dialog under ... button.

Resources