PhpStorm 10 + PHP 7.0.3 + xDebug 2.4.0RC3 not working - phpstorm

I've followed all the suggestions I've found, but I can't get PhpStorm working with PHP 7 and xDebug. I did have it working with PHP 5.6.
Xdebug is being loaded by PHP. I verified in the phpinfo() output. I've switched PhpStorm to use the PHP 7 version and it also lists the correct debugger as xdebug 2.4.0RC3
My xdebug settings are:
zend_extension = "/usr/local/opt/php70-xdebug/xdebug.so"
xdebug.remote_enable = 1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.remote_host = 127.0.0.1
xdebug.scream = 0
xdebug.cli_color = 1
xdebug.show_local_vars = 1
xdebug.idekey = PHPSTORM
I have the xdebug chrome extension installed, and it's correctly adding the Cookie:XDEBUG_SESSION=PHPSTORM;. I also enabled the debugging listener in PhpStorm.
Can anyone suggest what else I can do to try get my breakpoints to trigger?

So, in my case, I found that by moving the port from 9000 to 9001 fixed. I guess something else was already using the default port. Problem solved!

In case someone else lands here. For me the solution was that the path to the binary wasn't using "quotes".
[xdebug]
zend_extension = "C:\wamp\bin\php\php7.0.16\ext\php_xdebug-2.5.1-7.0-vc14-x86_64.dll"

Related

Xdebug 3 with Laravel Valet and PHP 8.1 is not working

I'm running PHP 8.1 with Xdebug 3 installed. And I have installed Laravel Valet.
I've tried so many things to make Xdebug work. I want to run it on port 9003
but unfortunately couldn't.
My php.ini Xdebug settings are (as you can see the commented settings that I was trying many things).
[xdebug]
zend_extension=xdebug.so
xdebug.remote_autostart=1
xdebug.default_enable=1
xdebug.remote_port=9003
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1
xdebug.remote_enable=1
xdebug.idekey=PHPSTORM
Below from here are all commented settings:
;xdebug.mode=debug
;xdebug.start_with_request=yes
;xdebug.client_host=localhost
;xdebug.client_port=9003
;zend_extension="xdebug.so"
;xdebug.start_upon_error=1xdebug.client_host=127.0.0.1
;xdebug.client_port=9003
;xdebug.force_display_errors=1
;xdebug.force_error_reporting=1
;xdebug.idekey=PHPSTORM
;xdebug.log=/tmp/xdebug.log
;xdebug.log_level=7
;xdebug.mode=debug
;xdebug.output_dir=/tmp
;xdebug.remote_autostart=1
;xdebug.remote_enable = 1
;zend_extension=xdebug.so
;[xdebug]
;xdebug.remote_enable = 1
;zend_extension=xdebug.so
;xdebug.start_with_request=yes
;xdebug.remote_autostart=1
;xdebug.mode=debug
;xdebug.discover_client_host = true
;zend_extension="xdebug.so"
;xdebug.remote_enable=1
;xdebug.remote_port=9001
;xdebug.remote_handler="dbgp"
;xdebug.remote_host="localhost"
;xdebug.idekey=
;xdebug.remote_enable=on
;xdebug.default_enable=on
;xdebug.remote_autostart=off
;xdebug.remote_port=9001
;xdebug.remote_host=localhost
;xdebug.profiler_enable_trigger=1
;xdebug.profiler_output_name=xdebug-profile-cachegrind.out-%H-%R
;xdebug.var_display_max_children = 128
;xdebug.var_display_max_data = 512
;xdebug.var_display_max_depth = 3
;xdebug.remote_enable = 1
;xdebug.idekey = PHPSTORM
;xdebug.show_error_trace = 1
;xdebug.file_link_format = phpstorm://open?%f:%l
These are my PhpStorm settings:
Any help please ?
The following config should be enough to get you going with php 8.1 and xdebug 3
zend_extension=xdebug.so
xdebug.mode=debug
xdebug.client_port=9003
xdebug.start_with_request=yes
xdebug.log=/tmp/xdebug.log
Also share the path to the .ini where you are keeping the xdebug settings. If you have cli and fpm subfolders under the config path for php 8.1, you would have to make sure both fpm and cli can read the xdebug settings

Xdebug Specified URL is not reachable, caused by: 'Request failed with status code 400'

I am trying to setup Xdebug with PhpStorm. When I try and validate my script, I get the following error:
Specified URL is not reachable, caused by: 'Request failed with status code 400'
The error used to display a 404 status code, but I applied the fix on this page: https://www.jetbrains.com/help/phpstorm/validating-the-configuration-of-the-debugging-engine.html#troubleshooting-validation-results
I haven't seen anything online for fixing a 400 status code.
I have the site setup on a local environment using nginx and an upstream using php-fpm.sock.
upstream site_backend {
server unix:/var/run/php/php7.4-fpm.sock;
}
And here is my xdebug.ini:
GNU nano 4.8 /etc/php/7.4/fpm/conf.d/20-xdebug.ini
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.var_display_max_depth = -1
xdebug.var_display_max_children = -1
xdebug.var_display_max_data = -1
xdebug.idekey = "PHPSTORM"
The site works, only Xdebug isn't working. PhpStorm is not registering anything from Xdebug.
Not sure what else is needed, let me know if you need anything else.
UPDATE:
Xdebug is version 3.0.4.
In the nginx error log, I saw something that might be helpful:
2021/04/19 10:26:08 [error] 736434#736434: *72 access forbidden by rule, client: 127.0.0.1, server: mysite.localhost, request: "GET /_intellij_phpdebug_validator.php HTTP/1.1", host: "mysite.localhost"
UPDATE 2:
I made the changes at https://xdebug.org/docs/upgrade_guide, still isn't working. Here is the update xdebug.ini:
zend_extension=xdebug.so
xdebug.mode=debug
xdebug.session=PHPSTORM
xdebug.start_with_request=yes
Not sure if it's correct configuration. I also double checked to make sure PHPStorm is listening on port 9003, which it is. I also restarted php-fpm as well.
I got the same issue and I was able to resolve this buy just replacing the default URL assigned (http://127.0.0.1) with my virtual host URL in PHPStorm > Run > Web Server Debug Validation > URL to validation script.
OS: Ubuntu 20.04.3 LTS
PHP version: 7.4.3
XDebug version: 2.9.2
/etc/php/7.4/mods-available/xdebug.ini:
zend_extension=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 #if you want to change the port you can change
xdebug.mode=debug
xdebug.start_with_request = yes
I got the same problem and I resolved this buy just
changing the value in the php.ini file of the xdebug.start_upon_error from the default "default" to "yes" due too https://www.jetbrains.com/help/phpstorm/configuring-xdebug.html#configuring-xdebug-docker
I got the same issue by using ddev ( = a docker wrapper).
The absolute path to my project is /var/www/html in ddev.
I had to write /var/www/html as the absolute path to my project in the phpstorm settings at php>servers.

How to configure Xdebug for JetBrains PhpStorm 2020.1?

So, I was quite happily debugging my PHP code with PhpStorm - until Windows became severely corrupted ... and my backup regime turned out to not quite as good as I had thought (let that be a lesson to many of us :-( )
Here's the relevant part of my php.ini:
[PHP]
[Xdebug]
; ---- trying to follow PHP storm's advice
zend_extension = "e:\coding\Web_development\php\php\ext\php_xdebug-3.0.1-7.3-vc15-x86_64.dll"
xdebug.remote_enable = 1
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1
;xdebug.remote_port = 9000
;xdebug.remote_mode = req
xdebug.idekey="xdebug"
; ---------- previously worked
;xdebug.remote_enable=1
;xdebug.remote_host=127.0.0.1
;xdebug.remote_port=9000
;xdebug.remote_autostart=1
;xdebug.remote_handler=dbgp
;xdebug.idekey="xdebug"
;xdebug.remote_log=m:\xdebug.log
;xdebug.profiler_enable=0
;xdebug.profiler_enable_trigger=0
;;xdebug.profiler_output_dir="F:\DropBox\programs\xampp\htdocs\_PHP_profile"
;xdebug.profiler_output_name=cachegrind.out.%s.%t
And, here's what PhpStorm says :
BUT much of that does not actually exist at https://xdebug.org/docs/all_settings - as if some of those settings are no longer relevant/supported.
So, can anyone post the relevant [Xdebug] portion of php.ini for PHP storm 2020.1 ?
The upgrade that's catching you out here is not PhpStorm, it's XDebug: XDebug 3.0 came out a couple of weeks ago, and has completely overhauled the settings. As mentioned in one of the messages in your screenshot there is an upgrade guide on the XDebug site
It looks like PhpStorm's checking script isn't fully updated yet, so it's recommending a confusing mixture of old and new settings.
The most important changes are:
The new xdebug.mode setting toggles a whole bunch of settings at once rather than having to remember the right combination. Some settings are simply no longer needed because of this.
The default port is now 9003 instead of 9000, because of some other popular software using the same port.
A lot of remaining settings have been renamed to be clearer.
Looking down your old config:
zend_extension = "e:\coding\Web_development\php\php\ext\php_xdebug-3.0.1-7.3-vc15-x86_64.dll"
; this tells PHP to load the XDebug extension
; note that the file name includes the version number, confirming that you're using v3
xdebug.remote_enable=1
; now implied by xdebug.mode=debug
xdebug.remote_host=127.0.0.1
; renamed xdebug.client_host
xdebug.remote_port=9000
; renamed xdebug.client_port
; also, the default is now 9003 not 9000
; so either set to 9000 here, or tell PhpStorm to use port 9003
xdebug.remote_autostart=1
; replaced with xdebug.start_with_request=yes
xdebug.remote_handler=dbgp
; no longer needed, as there was only one valid value
xdebug.idekey="xdebug"
; still supported, but not usually needed
xdebug.remote_log=m:\xdebug.log
; replaced by xdebug.log
xdebug.profiler_enable=0
; now implied by xdebug.mode=debug
xdebug.profiler_enable_trigger=0
; now implied by xdebug.mode=debug
xdebug.profiler_output_dir="F:\DropBox\programs\xampp\htdocs\_PHP_profile"
; not needed for debugging
xdebug.profiler_output_name=cachegrind.out.%s.%t
; not needed for debugging
So your new config should I believe look like this:
zend_extension = "e:\coding\Web_development\php\php\ext\php_xdebug-3.0.1-7.3-vc15-x86_64.dll"
xdebug.mode=debug
xdebug.client_host=127.0.0.1
xdebug.client_port=9000 ; or 9003, but should match the setting in PhpStorm
xdebug.start_with_request=yes
xdebug.idekey="xdebug"
xdebug.log=m:\xdebug.log

phpStorm, xDebug and Chrome debugging

I have reinstalled phpStorm 8 and Wamp 2.5
I set the appropriate php.ini file with the following.
zend_extension = "e:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11.dll"
;
[xdebug]
xdebug.remote_enable = true
xdebug.remote_port="9005"
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = On
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "e:/wamp/tmp"
xdebug.show_local_vars=0
In phpStorm under Stettings->PHP->Debug
I then set a breakpoint and start the debug listener in the top right screen of phpStorm.
I have downloaded the JetBrains IDE Support 2.0.8 extension for google chrome and set the port to 9005 as-well.
but phpStorm never stops on a breakpoint and I dont get the incoming convection messages that phpStorm normally gives when debugging?
Any help will be appreciated.

Trouble setting up XDebug with MAMP Pro 1.9.2 & MacGDBp v1.3.1

I installed the XDebug package at MAMP/bin/php5.2/lib/php/extensions/no-debug-non-zts-20060613
I put the following into my php.ini file:
zend_extension="/Applications/MAMP/bin/php5.2/lib/php/extensions/no-debug-non-zts-0060613/xdebug.so"
xdebug.remote_enable = On
xdebug.remote_autostart = 1
xdebug.remote_host = localhost
xdebug.remote_port = 9999
I disabled the zend optimizer.
I set the proper port # in MacGDBp.
I do get a proper stack trace from the command line.
What I'd like to do, though, is load a page in Firefox and debug with MacGDBp.
Shouldn't MacGDBp be reading and parsing whatever's coming though the specified port?
Can anyone tell me what I'm missing?
Thanks!
Well, you are a bit unspecific about your concrete setup but there seem to be few things odd with your settings.
I am not using mac and I don't know MacGDBp ... but MacGDBp suggests that it uses the old GDP-protocol. Though XDebug 2 uses by default the new DBG protocol.
You should make that explicit by setting 'xdebug.remote_handler' to your preferred protocol. In my case as I use the new protocol i feed it 'dpgp.
Here you find some information: http://www.xdebug.org/docs/remote
Also it could be that your firewall is blocking the port.
Maybe that'll do it, otherwise tell us more about the symptoms.
Best
Raffael
I was having the same problem.
What I did was:
install the xdebug-toggler plugin for Safari
load the page I was testing
enable the plugin
reload the page
And suddenly it worked.