XDebug stopped working in PHPStorm - xdebug

I've been beating my head against this for hours.
I've come back to do some work in PHPStorm after not having used it in a couple of weeks, and for some reason the debug doesn't work any more. It used to work, but now it doesn't and I have no idea what is going on.
I'm running on Windows, using IIS, PHP version 5.3.8. The XDebug is installed, and I've set the configuration in PHP.ini as per the usual instructions.
When I run phpinfo() everything looks normal (ie. XDebug is there).
I've rechecked various settings, downloaded a slightly newer version of XDebug than I was using (Xdebug v2.2.1), but nothing seems to kick it into life.
Can someone please give me some clues as to what I can look at next?
UPDATE:
I've spent a few more hours beating my head against this, and don't seem to have gotten much further. XDebug is installed and loaded, according to phpinfo(). I turned on logging, but it doesn't really tell me much except that XDebug is indeed connecting...
Log opened at 2013-02-17 04:13:07
I: Connecting to configured address/port: localhost:9000.
I: Connected to client. :-)
-> <init xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" fileuri="file:///C:/web/dbg/index.php" language="PHP" protocol_version="1.0" appid="6912" idekey="PHPSTORM"><engine version="2.2.1"><![CDATA[Xdebug]]></engine><author><![CDATA[Derick Rethans]]></author><url><![CDATA[http://xdebug.org]]></url><copyright><![CDATA[Copyright (c) 2002-2012 by Derick Rethans]]></copyright></init>
-> <response xmlns="urn:debugger_protocol_v1" xmlns:xdebug="http://xdebug.org/dbgp/xdebug" status="stopping" reason="ok"></response>
Log closed at 2013-02-17 04:13:07
So it seems that the problem is on the PHPStorm side, but I cannot see where. I tried creating a very simple project, but could not get that to debug either.

Don't you hate it when you spend hours wrestling with something, then in desperation try something simple, and it works?
I decided to try a different port, 9001 instead of the default 9000, and it WORKED!
I now realise that I recently installed Twonky (for video streaming to my TV), and when I checked the settings, there it was... port 9000.

Had the same issue this afternoon - found this question along with several other SO questions so I thought I'd post the solution that fixed it for me.
I was missing a mapping to the file system. Which is odd because I've seen PHPStorm prompt me when they've been missing previously.
Hopefully this helps someone in the future :)

Had the same problem after updating to El Capitan. First hint to that I used is Run -> Web Server Debug Validation.
This tool from PHPStorm gave me a hint about xdebug.remote_host I'm using v-hosts and it was complaining localhost being not the correct value there. So I updated xdebug setting with xdebug.remote_connect_back=On and it worked!

Apparently if you try to debug on newer versions of xdebug you have to include this line to your xdebug-php.ini settings
xdebug.mode=debug

I had same problem and I resolved it by deleting all the watches, and then reboot phpStorm

I resolved by by myself also, cause PHP-Storm and PHP-FPM are listening same port... just kill all php-fpm port.

Had the same problem. For me I was using port 9010 for xdebug. Problem turned out to be Logitech's GHub software I recently installed for a new mouse listens on port 9010! You can use this to see what is listening on a given port on Macs:
lsof -nP -iTCP:9010 | grep LISTEN

Newer versions of PHPStorm have Debugger validation. The official PHPStorm Blog has a writeup on this feature which might help you figure it out.
One snafu for me when I set up a box with php-fpm configured is that php-fpm runs on port 9000 by default also, so I had to change the configured port in php.ini and PHPStorm's preferences to something like 9001.
For what it's worth, my current php.ini setup for xdebug:
[xdebug]
zend_extension="/the/path/to/xdebug.so"
xdebug.file_link_format="txmt://open?url=file://%f&line=%l"
xdebug.remote_enable=1
xdebug.remote_autostart=On
xdebug.remote_port=9001
xdebug.profiler_enable_trigger=1
xdebug.max_nesting_level=250

I had the same problem! I finally realized that all my configurations were correct, but on the browser side, I hadn't enabled debugging with the Chrome Browser. Each browser has their own way of enabling the debugging to start working.

I had the same issue and I tried all the solutions I could find in SO and in other sites (checked that both phpStorm and Xdebug are on the same ports, checked that I had the server mapping on the file system, reinstalled Xdebug, etc.) but eventually the problem was in the fact that we run the site on an internal server, and someone from IT changed my computer's IP address to an address which is filtered out of the allowed addresses that can be connected to that server. That's why phpStorm started to ignore the breakpoints from Xdebug.
Hopefully, this will help someone in the future and save him many hours.

Found that if xdebug log file is not writable then it could be not working. Always better to set xdebug.remote_log and make it writable.

Related

npm says port is allready in even if you change the port

Recently I have started to use React Native and I didn't want to use Android Studio, so I manually installed every thing including hyper-v but after that I have a really strange problem if I put any port in .env file when I run npm start it saying that the port is in use!
And the other issue was when I was using JetBrains' products (like WebStorm) it won't start. I found this in log files :
java.net.BindException: Address already in use: bind
And the most strange thing was that the ports were not in use !
So after a week I found the solution .
The answer is really simple this is a problem with hyper-v and wsl2, and I don't know why it cause this problem.
I solved my problem using two commands (I'm using Windows 10) :
net stop winnat
net start winnat
I hope this fix your issue!
Edit:
Even after you reset the reserved ports by the command, after a full restart then you will need to run the command again.
This is because of windows sandbox. It'll re-reserve the ports.
So to fully fix the problem you need to turn off windows sandbox in windows features, that will fully fix the problem

Php-debug on atom doesn't work

Is anyone has done successfully on php debug integration on atom?
I tried to follow the steps from this link and from this
but this part
If everything worked correctly, you can now use the various
buttons/commands to step through the script.
doesn't work,
I am using xampp, bundle with php7, the problem, it doesn't work.
Does anyone done this before, can explain why?
of the instruction from php-debug
I tried the above answer, but kept getting a connection timeout after 200ms.
Re-installing Atom worked for me to fix the problem.
This is an old question but as I had the same problem it might be useful for someone.
In my case I needed to change the variable in the php.ini file
xdebug.remote_log=C:\xampp\htdocs\log\xdebug.log
This way you can see in the log if xdebug is working and if you are in error you can see the error
After analyzing the error, I changed the variables
xdebug.remote_host=10.20.200.100 #Use your IP
xdebug.remote_connect_back=0
I added it too
xdebug.idekey=xdebug-atom
It was as follows
zend_extension = C:\xampp\php\ext\php_xdebug-2.5.4-5.6-vc11.dll
xdebug.remote_enable=1
xdebug.remote_host=10.20.200.100 #Use your IP
xdebug.remote_connect_back=0
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_autostart=false
xdebug.idekey=xdebug-atom
xdebug.remote_log=C:\xampp\htdocs\log\xdebug.log
In the php-debug configuration on the Atom
"php-debug":
GutterBreakpointToggle: false
PathMaps: [
"\"C:\\xampp\\htdocs\\myproject;C:\\xampp\\htdocs\\myproject\""
]
ServerAddress: "10.20.200.100" <--Use your IP
These steps worked for me.

xdebug.remote_autostart, remote, and connect_back not turning on

I've spent some time trying to figure out why the autostart, remote , and connect_back settings wont turn on. I've typed in:
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_port=9000
xdebug.remote_autostart=1
xdebug.remote_connect_back=1
;xdebug.remote_host=192.168.1.108
All this into the php.ini file, restarted servers, and when I check the configuration page on the MAMP page, these settings still read OFF. Any idea why this is...
Bit late answer maybe but here's how I solved this issue.
For some reason MAMP conf files doesn't affect these settings, what I did was:
Go to /MAMP/bin/php/[phpX.X.XX ie your current version]/conf/php.ini and set it here.
This is super late, but, you need to edit the correct php.ini file. MAMP comes with 2 or more!
From the MAMP control/app launch the PHP_INFO() page, or make your own. Check the path value for the Loaded Configuration File
That is the php.ini to edit.

Xdebug doesn't work with phpstorm

Trying to set up XDebug with PhpStorm. I installed and configured it following this guide:
https://jtreminio.com/2012/07/xdebug-and-you-why-you-should-be-using-a-real-debugger/
At the moment it looks like that. I start a session, PhpStorm ask or asked me what connection to listen. There was just one file to select. app_dev.php (It's the index from Symfony) so I selected it. Wondering why there is just one file. Now I can only debug this only file. Everythign else doesn't work. Later, the pop up came again and I selected the project folder, but still. I can just debug the app_dev.php file. What is wrong with my settings?
I also heard, I can make the debugging without having to set the session, is this true? VIa xdebug.remote_autosrat = 1?
Xdebug php info: http://pastebin.com/LQGY7t0E
Xdebug php.ini settings: http://pastebin.com/8WjKWDZk
The settings in phpstorm are like this https://jtreminio.com/assets/posts/2012-07-05_xdebug-and-you-why-you-should-be-using-a-real-debugger/phpstorm.php_.debug_.png but I do have a external connection settings because i have anewer version. (I guess). Leave it as default.
I'm using ubuntu instaleld on a VM. I'm on Win7. I created a network map to Z: and connected with phpstorm to Z:
So, any hints on how a I can get it working?

Problems loading xdebug in wampserver2.0

I have an issue loading xdebug in apache server.
Here are my settings:
Apache 2.2.11
MySQL 5.1.36
PHP 5.2.0
Windows 7
Wampserver 2.0
php -i and php -m show that the xdebug module php_xdebug-2.1.0RC1-5.2-vc6.dll is installed.
However phpinfo() does not show that xdebug is installed. I have tried starting apache as a service, through the Wampserver UI, and by running httpd directly (as administrator) and I have checked permissions on the php_xdebug-2.1.0RC1-5.2-vc6.dll file.
There are no warnings in the logs. In the apache error log I get:
[Thu Jun 24 11:20:55 2010] [notice] Apache/2.2.11 (Win32) PHP/5.2.0 configured -- resuming normal operations
Has anyone any ideas?
Thank you,
John
I already do like you said but nothing happens
Using WAMPSERVER 2.1 , php_xdebug-2.1.0-5.3-vc6.dll (however I renamed it becoming php_xdebug.dll)
In php.ini, I also modified as instructions
extension=php_xdebug.dll
...
zend_extension = "C:/wamp/bin/php/php5.3.3/ext/php_xdebug.dll"
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.idekey="netbeans-xdebug"
After starting the server again, there are no error in Apache log, everything seems work normal.Still do not see any information about xdebug from phpinfo. I totally gave up :(
Any ideas for my case, appreciated that.
I solved my issue as I was using wampserver2.0 and naively assumed I could use c:\wamp\bin\php\php{version#}\php.ini to affect my configuration.
In actual fact one must use c:\wamp\apache\Apache{version#}\bin\php.ini to configure php on the wamp server.
Hope this helps anyone else who might one day tear their hair out over this.
John

Resources