XDebug configuration missing from php.ini in XAMPP

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 22:01:16

Here is an excellent tutorial that explains step by step procedure https://hubpages.com/technology/Local-PHP-Debugging-with-XDebug-Atom-and-XAMPP

As per this tutorial please follow these steps its works like a charm:

Steps to Install Xdebug:

  1. Download xdebug-2.4.0.tgz
  2. Unpack the downloaded file

    # navigate to the downloaded file
    $ cd ~/Downloads
    
    $ tar -xvzf xdebug-2.4.0.tgz
    $ cd xdebug-2.4.0
    
  3. run phpize

    $ phpize
    
    # example output
    Configuring for:
    PHP Api Version:         20131106
    Zend Module Api No:      20131226
    Zend Extension Api No:   220131226
    
    #Error possibilty
    Cannot find autoconf. Please check your autoconf installation and the
    $PHP_AUTOCONF environment variable. Then, rerun this script.
    
    #In the above error case you need to install autoconf using below command(MAC) and rerun phpize
    $ brew install autoconf
    

    The phpsize command is used to prepare the build environment for a PHP extension.

  4. Configure it by run:

    $ ./configure
    
  5. run make

    $ make
    

A successful install will have created xdebug.so file.

Steps to Configure Xdebug:

A successful install will have created xdebug.so and put it into the PHP extensions directory.

  1. You must copy this file to XAMPP php extension directory for that run:-

    $ sudo cp modules/xdebug.so /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20160303
    
  2. Finally update /Applications/XAMPP/xamppfiles/etc/php.ini and add the following lines to it

    [Xdebug]
    zend_extension = /Applications/XAMPP/xamppfiles/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so
    xdebug.remote_enable=1
    xdebug.remote_connect_back=On
    xdebug.remote_port="9000"
    xdebug.profiler_enable=0
    xdebug.remote_handler=dbgp
    xdebug.remote_mode=req
    xdebug.remote_autostart=true
    
  3. Restart Apache using XAMPP’s manager-osx

Congratz! You have completed!! To verify you successfully installed & configured XDebug, open the XAMPP phpinfo.php file in a web browser, for example, http://localhost/dashboard/phpinfo.php.

  • Search for XDebug section in PHPInfo details. If it exists, you successfully have done your installation OR
  • In another browser window or tab, open https://xdebug.org/wizard.php and copy the phpinfo.php page content in the first window or tab and paste it into the textbox on the xdebug.org page. Then submit for analysis, it will give a summary of your installation status.

Safest was is to use XDebug wizard that will give you step by step instructions on how to install on your own machine. Then update your php.ini (tune to your needs)

Note: Wizard will give you instructions for what SAPI it receives phpinfo() contents from. So if you fill CLI phpinfo() output you will get instructions for your PHP CLI. If you paste phpinfo() from a server page you will get instructions for that.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!