14

I have added following lines into php.ini

[XDebug]
zend_extension = C:\PROGRA~1\PHP5\ext\php_xdebug-2.1.0-5.3-vc9.dll
xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000

Version of php_xdebug-2.1.0-5.3-vc9.dll is obtained via page http://www.xdebug.org/find-binary.php.

But there are no any mentions of 'xdebug' string in output of phpinfo().

What can be wrong?

(This is my second fight with php-xdebug to get working, first time I gave up. If you have other suggestions concerning debugging please add them also, possibly as comments to the question. I would like to following scenario work under windows: "Set up break point, run my script, it stops on break point and I can see the value of some variable". Thanks)

UPDATE

Restart of Apache does not resolve the issue. In log file the message appears:

Apache/2.2.14 (Win32) PHP/5.3.1 configured - resuming normal operations

Community
  • 1
  • 1
sergtk
  • 10,714
  • 15
  • 75
  • 130
  • 1
    Have you restarted your web server? – Nev Stokes Sep 25 '10 at 11:23
  • If you have restarted your web server as Nev Stokes suggests, check its error log for any indications – Fanis Hatzidakis Sep 25 '10 at 12:11
  • I updated the question - restart of Apache does not resolve the issue, and error log does not contain an error – sergtk Sep 25 '10 at 12:48
  • I don't know how to do this in Windows, but you should try to run an apache configuration test, to see if you get messages other than "Syntax OK". Also, you can check your php.ini file is taken into account by editing a setting in it and checking your phpinfo() to see if this setting does change. – greg0ire Sep 25 '10 at 13:14
  • 1
    Search your hdd for php.ini, under Windows on some occasions (depending on the way you got PHP) there may be multiple php.ini's file and you may have modified the wrong one. – mhitza Sep 25 '10 at 20:00

13 Answers13

15

check the top of the output of

php -m

for me it showed an error in php.ini, after solving that xdebug was loaded.

Flion
  • 10,468
  • 13
  • 48
  • 68
  • had the same issue. I ran php from xampp/php/php.exe . Problem was that i was using xdebug 64 bit,but xampp 32 bit – M.C. Jul 22 '16 at 09:26
  • 2
    The instructions for installing the XDebug extension specified the path string to add to PHP.INI as ext\php_xdebug-2.5.4-5.6-vc11-x86_64.dll, which is wrong. Since the standard PHP.INI specifies ./ext as the default extension directory, this setting adds an extra ext directory when it resolves the path, causing the load to fail. In a standard PHP installation, the correct path is php_xdebug-2.5.4-5.6-vc11-x86_64.dll. – David A. Gray Oct 11 '17 at 20:38
10
zend_extension = C:\PROGRA~1\PHP5\ext\php_xdebug-2.1.0-5.3-vc9.dll

should be replaced by

zend_extension="C:\PROGRA~1\PHP5\ext\php_xdebug-2.1.0-5.3-vc9.dll"

P.S. Will e-mail xdebug guys.

sergtk
  • 10,714
  • 15
  • 75
  • 130
7

This worked for me (vscode, xampp) Go to https://xdebug.org/wizard.php and paste the contents of phpinfo()

Then download the right xdebug.dll and place it in your 'ext' folder.

Add the following to your php.ini

[XDebug]
zend_extension="php_xdebug-2.5.4-7.0-vc14.dll"
xdebug.remote_enable=1
xdebug.remote_autostart=1
Ger Groot
  • 1,071
  • 11
  • 7
  • the link you mentioned shows detailed instruction i.e. what to add in `php.ini`. I did not need to add all the lines you mentioned. – Istiaque Ahmed Nov 22 '17 at 14:16
  • I use WSL2 and run docker, output `system` of `phpinfo()` is `Linux b018e9f7682c 4.19.128-microsoft-standard #1 SMP Tue Jun 23 12:58:10 UTC 2020 x86_64`. The wizard shows `zend_extension = /usr/local/lib/php/extensions/no-debug-non-zts-20180731/xdebug.so` in `/usr/local/etc/php/php.ini`. I restart webserver with `docker-compose down` and then `docker-compose up` to no avail, no `xdebug` section in phpinfo. – Timo Oct 15 '20 at 12:41
6

I just had the same problem, nothing of this worked for me. I started php in the console and I saw, php was unable to load the dll from the given path. The solution for me was to omit the path information and only load it like this:

zend_extension="php_xdebug-2.2.5-5.5-vc11.dll"
westor
  • 1,426
  • 1
  • 18
  • 35
3

You can follow this tutorial on getting started with xdebug : http://devzone.zend.com/article/2803-Introducing-xdebug

Xdebug and ZendDebug are two separate debuggers, it's up to you to decide which one to use. Either one is pretty easy to setup. Only a couple of steps in Eclipse.

Post the content from your php info page into this page to find out which version to download : http://www.xdebug.org/find-binary.php

Gainster
  • 5,481
  • 19
  • 61
  • 90
2

I was just struggling with this myself and found a way to identify (and solve) the problem. It works on Xampp and Windows 7 at least.

In my case the problem was dots. Renaming "php_xdebug-2.2.5-5.5-vc11.dll" to "php_xdebug.dll" did the job.

Another pro-tip is that newer versions of Xampp have Xdebug built-in, so you don't need to donwload it, just edit php.ini with:

zend_extension = "path\to\php\ext\php_xdebug.dll"
xdebug.remote_enable = on
xdebug.remote_handler = dbgp
xdebug.remote_host = 127.0.0.1 (or localhost)
xdebug.remote_port = 9000
xdebug.remote_mode = req

Then restart the apache and it should work. The advantage of using xampp built-in xdebug is that it's most likely the right version.

P.Pal
  • 63
  • 9
1

Writing in January 2019, I found that following the Xdebug Wizard at Xdebug wizard here

exactly, including using their download link to the correct version of Xdebug for your version of PHP and copying the line to insert on your php ini exactly as is, got Xdebug appearing in phpInfo for me. I was installing into Laragon . Running php -m from the command line gave a good confirmation of all being well, with Xdebug loading as a Zend Extension. Usual gotchas about needing to restart server etc apply.

Geoff Kendall
  • 1,307
  • 12
  • 13
1

In my case, Xdebug is showing in php -m, php -i but not in phpinfo() result.

Restarting Apache didn't help until restarting php-fpm

systemctl restart php-fpm.service
The Anh Nguyen
  • 748
  • 2
  • 11
  • 27
0

Its happen because of permission. you have to add the permission of that specific app/user profile from the folder's Properties Security tab.

I use PHP with IIS server so. It worked for me by adding IIS_USER in security permission.

FAHID
  • 3,245
  • 3
  • 18
  • 15
0

in my case the issue was the php.symlink file in the C:\wamp64\bin\apache\apache2.4.23\bin folder , this file links to the php.ini file existed in C:\wamp64\bin\php\php5.6.25 but apparently it wasn't working so i've deleted it and copy paste the actual php.ini to the same folder and it worked.

if you want to return the php.symlink back open cmd in the C:\wamp64\bin\apache\apache2.4.23\bin and write the following (windows):

mklink php.ini C:\wamp64\bin\php\php5.6.25\php.ini

replace the path to point to your php.ini inside your php file

Mawardy
  • 3,618
  • 2
  • 33
  • 37
0

Just for the newbees:

If you want to check if the .dll, specified in the php.ini is loading properly:

  1. Add php to the Windows Runtime Directory. For win10, refer to this post https://www.forevolve.com/en/articles/2016/10/27/how-to-add-your-php-runtime-directory-to-your-windows-10-path-environment-variable/

  2. From the Windows command prompt, type php -m and check if any error is displayed.

Dimitri
  • 1
  • 3
0

In my case the issue was the file path which apache loaded, the file php.ini I changed is not the current loaded config, so check it First.

chuixue
  • 11
  • 2
0

xdebug appears in "php -m" command line BUT nothing on the browser <?php phpinfo(); page ! Check in httpd.conf PHPIniDir "C:/to/the/RIGHT/phpversion" The command line php.exe use the Environment PATH variable but nut the apache !

François Breton
  • 1,158
  • 14
  • 24