xdebug.org icon indicating copy to clipboard operation
xdebug.org copied to clipboard

/wizard gives incorrect instruction for installing on windows

Open cburschka opened this issue 5 years ago • 3 comments

After pasting my phpinfo(), I was prompted to add zend_extension = ext\php_xdebug-2.9.6-7.4-vc15-x86_64.dll to my php.ini.

This doesn't work; the correct line to use was zend_extension = php_xdebug-2.9.6-7.4-vc15-x86_64.dll.

My stock php.ini file appears to have extension_dir set to ext:

; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
;extension_dir = "./"
; On windows:
extension_dir = "ext"

cburschka avatar Jun 07 '20 12:06 cburschka

I would need to see the full contents of what you passed into the wizard to debug this. I don't keep these in a log. However, I think the issue is that traditionally "extension_dir" was required to be a full absolute path, and not a relative one.

derickr avatar Jun 21 '20 14:06 derickr

I just stumbled upon the same thing. Using PHP 7.4.x with Windows 10 and IIS, extension_dir defaults to the full path to the "ext" folder of the PHP directory, in my case C:\php\ext.

Then, the wizard correctly yields: zend_extension = C:\php\ext\php_xdebug-2.9.8-7.4-vc15-nts-x86_64.dll

However if I manually set extension_dir=ext as suggested in the php.ini file, then extension_dir is also reported as "ext", which yields the result @cburschka described.

So at least under Windows, extension_dir is not necessarily an absolute path. I would therefore recommend just providing the extension file name for Windows systems.

Trivial PR for this is on the way (no, not for Botoktoberfest or what it's called ;-) ), but let me get hold of some older PHP versions the see when this behaviour started. I always thought extension_dir would return an absolute path.

wenz avatar Oct 01 '20 12:10 wenz

I checked with PHP versions back to 7.0, both (Fast)CGI and the Apache module, and they all report the extension_dir value verbatim, so the value of "ext" (as recommended in php.ini) will be reported as "ext". Since the instructions recommend to put the DLL into the extension directory anyway, I'd recommend to go ahead with the approach from my PR.

wenz avatar Oct 02 '20 15:10 wenz