Posted in PHP

Xdebug not running with WAMP in CLI

Though Xdebug is installed and enabled in php.ini, it fails to run through CLI when using WAMP

 

Check what version is installed for CLI using

php -v

It should give something like this: (mine)

PHP 7.0.10 (cli) (built: Aug 18 2016 09:48:53) ( ZTS )
Copyright (c) 1997-2016 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies

It can be seen that PHP 7.0.10 is the version installed. Now,

  1. Open php.ini from wampmanager > php > php.ini
  2. Copy the entire [xdebug] section. Something similar to this:
    ; XDEBUG Extension
    [xdebug]
    zend_extension ="c:/wamp64/bin/php/php7.0.10/zend_ext/php_xdebug-2.5.1-7.0-vc14-x86_64.dll"
    
    xdebug.remote_enable = off
    xdebug.profiler_enable = On
    xdebug.profiler_enable_trigger = On
    xdebug.profiler_output_name = cachegrind.out.%t.%p
    xdebug.profiler_output_dir ="c:/wamp64/tmp"
    xdebug.show_local_vars=0
  3. Now using any text editor open
    \wamp\bin\php\php{version}\php.ini

    So, mine would be:

    \wamp64\bin\php\php7.0.10\php.ini

    Note: I have installed 64 bit version, so wamp64 otherwise it should be just wamp. Also, my php version as of this writing is 7.0.10.

  4. Paste the [xdebug] section that you copied in step 2.
  5. Save php.ini file. Now you should be seeing:
    PHP 7.0.10 (cli) (built: Aug 18 2016 09:48:53) ( ZTS )
    
    Copyright (c) 1997-2016 The PHP Group
    
    Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies
    
     with Xdebug v2.5.1, Copyright (c) 2002-2017, by Derick Rethans

    When running php -v. The last line states that now Xdebug v2.5.1 is enabled in CLI

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s