Is it possible to use xdebug on Ubuntu?

后端 未结 7 1690
甜味超标
甜味超标 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 14:49

    ::ubuntu 18.04, php7.2, apache2:: 1. First install xdebug using sudo apt-get install php-xdebug. 2. This will create file /etc/php/7.2/mods-available/xdebug.ini 3. You can run sudo phpenmod xdebug 4. open xdebug.ini using sudo nano /etc/php/7.2/mods-available/xdebug.ini 5. you can see only the line: zend_extension=xdebug.so 6. assuming running php apache on localhost and netbeans IDE, add following line to xdebug.ini

    xdebug.show_error_trace = 1
    xdebug.idekey=netbeans-xdebug
    xdebug.default_enable=1
    xdebug.remote_enable=1
    xdebug.remote_handler=dbgp
    xdebug.remote_host=localhost
    xdebug.remote_port=9000
    xdebug.remote_autostart=1
    

    N.B: xdebug.idekey and xdebug.remote_port can be obtained from netbeans tools->optins->php->debug

提交回复
热议问题