Is it possible to use xdebug on Ubuntu?

后端 未结 7 1700
甜味超标
甜味超标 2020-12-12 14:15

I am trying to debug some PHP code and wanted to download the XDebug debugger for PHP. All I see there is Windows binaries for downloading. Is it at all possible to use it

7条回答
  •  甜味超标
    2020-12-12 15:05

    Proper way to install XDEBUG for newest version of LAMPP:

    1. Download: XDEBUG latest version called source.

    2. Extract file to any folder.

    3. Open this folder with terminal.

    4. Change X.X.X to Your actually version of php

    5. Execute the following commands in your terminal.

      /opt/lampp/bin/phpize-X.X.X
      ./configure --with-php-config=/opt/lampp/bin/php-config-X.X.X
      make
      cp modules/xdebug.so /opt/lampp/lib/php/extensions/no-debug-non-zts-20170718
      

    Now we need edit file php.ini

    1. Open folder where is file php.ini in terminal:

      sudo nano ./php.ini
      
    2. Add to the end of file this:

      zend_extension = /opt/lampp/lib/php/extensions/no-debug-non-zts-20170718/xdebug.so
      
    3. Open LAMPP folder in terminal

    4. Now restart Apache.

      sudo ./xampp restart
      

    And now You can check phpinfo() to see XDEBUG is installed.

提交回复
热议问题