tu_hang
tu_hang

Reputation: 51

How to Select the correct version of xdebug?

I've been struggling to get Xdebugger set up in PHPStorm on my Windows.

Here's a summary of what I've tried and found. Any help would be much appreciated.

I installed XAMPP for Win v7.3.0 (PHP7.3.0). After installing XAMPP, I can open Chrome and go to localhost and I see the proper Apache sites such as dashboard, phpmyadmin, and phpinfo. I can confirm the php info shows v7.3.

I tried a number of ways but was unable to install xdebug

Here is some of my configuration information

php -i

Failed loading D:\6_Workstations\XAMPP\php\ext\php_xdebug-2.7.0beta1-7.3-vc15-x86_64.dll
phpinfo()
PHP Version => 7.3.0

System => Windows NT DESKTOP-MF9SPGT 10.0 build 17763 (Windows 10) i586
Build Date => Dec  6 2018 01:51:18
Compiler => MSVC15 (Visual C++ 2017)
Architecture => x86
Configure Command => cscript /nologo configure.js  "--enable-snapshot-build" "--enable-debug-pack" "--with-pdo-oci=c:\php-snap-build\deps_aux\oracle\x86\instantclient_12_1\sdk,shared" "--with-oci8-12c=c:\php-snap-build\deps_aux\oracle\x86\instantclient_12_1\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--without-analyzer" "--with-pgo"
Server API => Command Line Interface
Virtual Directory Support => enabled
Configuration File (php.ini) Path => C:\Windows
Loaded Configuration File => D:\6_Workstations\XAMPP\php\php.ini
Scan this dir for additional .ini files => (none)
Additional .ini files parsed => (none)
PHP API => 20180731
PHP Extension => 20180731
Zend Extension => 320180731
Zend Extension Build => API320180731,TS,VC15
PHP Extension Build => API20180731,TS,VC15
Debug Build => no
Thread Safety => enabled
Thread API => Windows Threads
Zend Signal Handling => disabled
Zend Memory Manager => enabled
Zend Multibyte Support => provided by mbstring
IPv6 Support => enabled
DTrace Support => disabled

Registered PHP Streams => php, file, glob, data, http, ftp, zip, compress.zlib, compress.bzip2, https, ftps, phar
Registered Stream Socket Transports => tcp, udp, ssl, tls, tlsv1.0, tlsv1.1, tlsv1.2
Registered Stream Filters => convert.iconv.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk, zlib.*, bzip2.*

This program makes use of the Zend Scripting Language Engine:
Zend Engine v3.3.0-dev, Copyright (c) 1998-2018 Zend Technologies

Xdebug

Tailored Installation Instructions
Summary

    Xdebug installed: no
    Server API: Command Line Interface
    Windows: yes - Compiler: MS VC15 - Architecture: x86
    Zend Server: no
    PHP Version: 7.3.0
    Zend API nr: 320180731
    PHP API nr: 20180731
    Debug Build: no
    Thread Safe Build: yes
    Configuration File Path: C:\Windows
    Configuration File: D:\6_Workstations\XAMPP\php\php.ini
    Extensions directory: D:\6_Workstations\XAMPP\php\ext

Instructions

    Download
    Move the downloaded file to D:\6_Workstations\XAMPP\php\ext
    Edit D:\6_Workstations\XAMPP\php\php.ini and add the line
    zend_extension = D:\6_Workstations\XAMPP\php\ext\

He didn't recommend a version for me?

php.ini

[Xdebug]
zend_extension =D:\6_Workstations\XAMPP\php\ext\php_xdebug-2.7.0beta1-7.3-vc15-x86_64.dll

Include

The official website did not recommend the correct version to me. I tried two beta versions of 7.3 and also restarted the Apache server of xampp.There is something wrong with my PHP version, maybe xdebug does not support this version?

Upvotes: 4

Views: 5706

Answers (2)

shaheen g
shaheen g

Reputation: 781

I just pasted my answer in another post. But here in case.

How to install Xdebug for PHP 5.6

  1. Run the phpinfo() or run php.exe -i
  2. In phpinfo,
    • The Architecture says it is a x86 (32 bit) or x64 (64 bit) structure.
    • The Zend Extension Build says what you need to download. e.g. API220131226,TS,VC11 (note that TS means Thread Safe; sometime you see ZTS: Zend Thread Safe)
  3. Go to Compatibility Matrix and whcih version of Xdebug matches the PHP version.
    • E.g. for PHP 5.6, we can use Xdebug 2.3, 2.4, or 2.5. Get the latest version, i.e. 2.5 here.
  4. Go to Xdebug Historical Releases and download the proper version.
    • So, for PHP 5.6, 32-bit, and Zend of API220131226,TS,VC11, You need to download Xdebug 2.5.5 and click on PHP 5.6 VC11 TS (32 bit) which will download php_xdebug-2.5.5-5.6-vc11.dll file. (Note the Visual C++ version of the Zend Extension Build, here VC11).
  5. Copy the file to C:\php\ext\ folder. (assuming PHP is installed here).
  6. Open php.ini file and under the [PHP] section you find ; Windows Extensions comment. At the end of extensions, add these lines.
    • zend_extension = "C:\PHP\ext\php_xdebug-2.5.5-5.6-vc11.dll"
    • xdebug.remote_enable=1
    • xdebug.remote_host="localhost"
    • xdebug.remote_port=9000
  7. Run C:\php.exe -v and you should see that Xdebug is loaded. if you see it has failed loading the dll (the first message), then most likely you have downlaoded the wrong dll file.
    • PHP 5.6.30 (cli) (built: Jan 18 2017 19:48:22)
    • Copyright (c) 1997-2016 The PHP Group
    • Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    • with Xdebug v2.5.5, Copyright (c) 2002-2017, by Derick Rethans

Upvotes: 0

Martin Zeitler
Martin Zeitler

Reputation: 76639

it reads x86 (and not x86_64), VC15 and Thread Safe Build: yes

therefore you'd need x86, VC15, for ZTS (called TS on Windows).

PHP 7.3 VC15 TS (32bit) does not exist (at least it's not already built).

you could run xdebug for PHP 7.2 in 32bit mode - or upgrade to 64bit.

Upvotes: 3

Related Questions