I am trying to set xdebug. I do use XAMPP portable, PHP v 7.4.11. I downloaded dlls php_xdebug-3.0.2-7.4-vc15-x86_64.dll and php_xdebug-3.0.2-7.4-vc15-nts-x86_64.dll and put them in \xampp\php\ext. Then I set php.ini file:
implicit_flush = On
zend_extension_ts = H:\xampp\php\ext\php_xdebug-3.0.2-7.4-vc15-x86_64.dll
xdebug.remote_enable=1
xdebug.remote_host="localhost"
xdebug.remote_port=9000
xdebug.remote_handler="dbgp"
xdebug.profiler_enable = 0
xdebug.profiler_output_dir = \tmp
xdebug.dump_globals=On
xdebug.show_exception_trace=On
xdebug.collect_params=4
I restarted server, but I can not see any info about xdebug at http://localhost/dashboard/phpinfo.php or among modules in php shell. I have tried both downloaded dlls, various ports, relative/absolute path. Nothing works. There are a few tutorials online, but they might be out of date, or is there problem with portable setting? Any idea, please?
I changed dll`s path and settings:
zend_extension=php_xdebug-3.0.2-7.4-vc15-x86_64.dll
[XDebug]
xdebug.mode=debug
xdebug.client_host = localhost
xdebug.client_port = 9003
xdebug.remote_handler="dbgp"
xdebug.output_dir = H:\xampp\tmp
Now after php -v in php console I get:
PHP 7.4.11 (cli) (built: Sep 29 2020 13:18:06) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Xdebug v3.0.2, Copyright (c) 2002-2021, by Derick Rethans
So that is good. At http://localhost/dashboard/phpinfo.php:
According to https://wiki.php.net/internals/extensions, since php 5.5 there is no needed to fill whole path to dll, only it`s name
Related
Description
xdebug seems to handle 0 as well as "0" values as null values if it is enabled and PhpStorm actively listens to incoming connections.
If xdebug is enabled but PhpStorm doesn't listen to connections ("the debugger is disabled" - so to speak), the website works perfectly fine.
If xdebug is disabled and PhpStorm doesn't listen to connections, the website works perfectly fine.
Example
This results in different errors in a Magento 2 project. And it seems this primarily occurs in PHPs magic functions like __call (\Magento\Framework\DataObject::__call). But that's just a guess and really hard to say as I'm always getting the right values if every step is debugged (0 stays 0).
I'm working on a Ubuntu machine with a PHP docker container.
php -v outputs the following information:
PHP 8.1.12 (cli) (built: Oct 28 2022 17:39:37) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.12, Copyright (c) Zend Technologies
with Zend OPcache v8.1.12, Copyright (c), by Zend Technologies
with Xdebug v3.1.5, Copyright (c) 2002-2022, by Derick Rethans
xdebug is configured as follows:
zend_extension=xdebug.so
xdebug.mode = debug
xdebug.start_with_request = default
xdebug.client_host = "${HOST_IP}"
xdebug.client_port = 9000
xdebug.discover_client_host = false
xdebug.idekey = "PHPSTORM"
; xdebug error handling
xdebug.force_display_errors = 0
xdebug.halt_level = 0
xdebug.show_error_trace = 0
xdebug.show_exception_trace = 0
xdebug.scream = 0
xdebug.max_nesting_level = 512
Are there any known bugs or fixes for this issue?
System:
OS Name Microsoft Windows 10 Pro
Version 10.0.19041 Build 19041
dll location and version:
C:\xampp\php\ext\php_xdebug-2.9.8-7.4-vc15-x86_64.dll
php.ini info:
C:\xampp\php\php.ini
[XDebug]
zend_extension = C:\xampp\php\ext\php_xdebug-2.9.8-7.4-vc15-x86_64.dll
phpinfo():
This program makes use of the Zend Scripting Language Engine: Zend
Engine v3.4.0, Copyright (c) Zend Technologies
with Xdebug v2.9.8, Copyright (c) 2002-2020, by Derick Rethans
php -v output:
PHP 7.4.3 (cli) (built: Feb 18 2020 17:29:57) ( NTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
When I run php -m, the output is
[PHP Modules]
(a bunch of modules, but no xdebug)
[Zend Modules]
(empty)
Where do I go from here?
I would bet your php_xdebug-2.9.8-7.4-vc15-x86_64.dll is just not compatible with your PHP.
Double check if you don't see anywhere something like
Failed loading C:\xampp\php\ext\php_xdebug-2.9.8-7.4-vc15-x86_64.dll
Also check if your edited php.ini is really used by your php binary.
In my Windows box I have zend_extension=php_xdebug-2.9.8-7.4-vc15-x86_64.dll in php.ini and PHP 7.4.10 (cli) ( ZTS Visual C++ 2017 x64 ) and it works like charm.
Check NTS vs ZTS. Maybe you should use php_xdebug-2.9.8-7.4-vc15-nts-x86_64.dll
When I type command php -v in Linux CentOS 7 the output is:
PHP 7.2.2 (cli) (built: Feb 19 2018 03:52:18) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
But when in try to install Xdebug I got this error:
configure: error: not supported. Need a PHP version >= 7.0.0 and < 7.3.0 (found 5.6.33)
What's the problem?
EDIT
I rebuild my PHP version and that solved it.
I rebuild my php version and solved
On Mac Sierra:
I've got php 7.1 installed, and installed xdebug via:
brew install php71-xdebug
Xcode is 8.0
php -v
Cannot load Xdebug - it was already loaded
PHP 7.1.0RC3 (cli) (built: Oct 2 2016 01:05:16) ( NTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.1.0-dev, Copyright (c) 1998-2016 Zend Technologies
with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans
With a phpinfo() I cannot find any text that says xdebug
The php.ini file I've tried several variations of: and restarted apache
[xdebug]
zend_extension="/usr/local/opt/php71-xdebug/xdebug.so"
xdebug.remote_host=127.0.0.1
xdebug.remote_connect_back=1 # Not safe for production servers
xdebug.remote_port=9000
xdebug.remote_handler=dbgp
xdebug.remote_mode=req
xdebug.remote_autostart=true
More details can be found here: https://bugs.xdebug.org/view.php?id=1354
PHP7.1 is current not supported by xdebug, (php version <7.1). you should use 7.0 instead, and don't forget to turn on xdebog.remote_enable
The xdebug server doesn't connect to any of the clients on port 9000 ie:Netbeans IDE ,debugclient etc.xdebug is shown in phpinfo output.The above clients keep on waiting for the connection to be established.when ever I try to run a php script from the cli it gives the following warning message:
"PHP Warning: Module 'xdebug' already loaded in Unknown on line 0"
The 9000 port has been opened and shows up in the netstat --numeric-port -l command.
I have no idea what might have gone wrong.I have checked all the configuration files,everything seems ok. Any help will be appreciated.
Section of my configuration files
Linux abc.localdomain 3.1.1-2.fc16.x86_64 #1 SMP Mon Nov 14 15:46:10 UTC 2011 x86_64
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies
with Xdebug v2.1.2, Copyright (c) 2002-2011, by Derick Rethans
[Zend]
zend_extension=/usr/lib64/php/modules/xdebug.so
[XDebug]
xdebug.remote_enable=On
xdebug.remote_autostart=On
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.remote_mode=req
xdebug.remote_log=/var/log/xdebug.log
php_api no. coincides
Xdebug Simple DBGp client (0.10.0)
Copyright 2002-2007 by Derick Rethans.
- libedit support: enabled
Waiting for debug server to connect.
Is it black magic!!
Thank You
It was actually Selinux not allowing Httpd to connect to other network resources.
Setting the boolean for httpd solved the problem:
setsebool -P httpd_can_network_connect on
OS Fedora 16-X_64
For me the solution was
sudo chcon -R -h -t /path/to/xdebug.so
meaning SELinux now allows httpd to execute this shared object.