Using Xdebug on windows and PhpStorm

Check which php.ini you are using with  php --ini

Install Xdebug

  • Check which version of PHP are you using, thread safe or not? php -i|grep "Thread"
  • Download the right version for your php version from xdebug.org
  • Copy the downloaded dll into your php extensions, in my case C:/wamp/bin/php/php7.0.7/ext/
  • Edit the php.ini file by adding this :
    ; XDEBUG Extension
    zend_extension="C:/wamp/bin/php/php7.0.7/ext/php_xdebug-2.4.0-7.0-vc14-x86_64.dll"
    
    ; Xdebug features two ways of enabling the profiler, depending on the type of 
    ; application we want to profile. Setting the xdebug.profiler_enable directive 
    ; enables profiling for any application. For web applications, profiling can be 
    ; enabled on demand by specifying a special GET/POST variable or a cookie. 
    ; This can be done using the PhpStorm bookmarklets (or one of the Browser Debugging Extensions) 
    ; and setting the xdebug.profiler_enable_trigger directive to 1 in php.ini.
    ; More at https://confluence.jetbrains.com/display/PhpStorm/Profiling+PHP+applications+with+PhpStorm+and+Xdebug
    
    [Xdebug]
    xdebug.remote_enable=1
    xdebug.remote_port=9000
    
    ; If it is set to 1, then you can enable the profiler by using a GET/POST or 
    ; COOKIE variable of the name XDEBUG_PROFILE. xdebug.profiler_enable needs 
    ; to be set to 0
    xdebug.profiler_enable_trigger=1
    
    xdebug.profiler_enable=0
    xdebug.profiler_output_dir="C:/wamp/logs/profiling"
    xdebug.idekey=PHPSTORM