Xdebug configuration with PHP fastcgi and eclipse?

后端 未结 5 745
-上瘾入骨i
-上瘾入骨i 2021-01-05 01:21

I have been using eclipse-pdt in conjunction with xdebug and apache without problems, for over one year. Things worked flawlessly and I could do all the interactive debuggin

相关标签:
5条回答
  • 2021-01-05 02:03

    I had the same problem and solved it.
    In file /etc/php5/apache2/php.ini add:

    [xdebug] xdebug.remote_enable=On
    xdebug.remote_autostart=off
    xdebug.remote_handler=dbgp
    xdebug.remote_host=localhost
    xdebug.remote_port=9000
    xdebug.remote_mode=req
    


    In file /etc/php5/cli/php.ini add:

    zend_extension=/usr/lib/php5/20060613/xdebug.so
    xdebug.remote_enable=On
    xdebug.remote_autostart=off
    xdebug.remote_handler=dbgp
    xdebug.remote_host=localhost
    xdebug.remote_port=9000
    xdebug.remote_mode=req
    


    Restart Apache:

    sudo service apache2 restart
    
    0 讨论(0)
  • 2021-01-05 02:04

    xdebug and FastCGI use the same default port (9000). Change the port of XDebug in your php.ini file like this:

    xdebug.remote_port=9001
    

    and update your IDE settings to use 9001.

    0 讨论(0)
  • 2021-01-05 02:05

    What Beau said is correct (couldn't vote since I'm new!).

    Generally, addging to /etc/php5/cgi/php.ini (or locate php.ini) the lines like

    zend_extension = /PATH_TO/xdebug.so   ## <-- NOTE the absolute path, not relational (For ex on Windows: "C:\nginx-1.9.13\php\ext\php_xdebug-2.6.0RC2-7.0-vc14-nts.dll")
    xdebug.remote_enable = on
    xdebug.remote_handler = dbgp
    xdebug.remote_host = localhost
    xdebug.remote_port = 9900        ## <-- Yours will be probly 9000 or other..
    

    does the job.

    So after the change,

    ./php-fastcgi stop
    ./php-fastcgi start
    

    This worked for me.

    0 讨论(0)
  • 2021-01-05 02:14

    Try restarting your php. Because you have php-fastcgi, restarting nginx doesn't seem to do it. When I rebooted my whole server the change took effect.

    0 讨论(0)
  • 2021-01-05 02:16

    Problem in solution is "xdebug.remote_autostart = on". If you set in file config "xdebug.remote_autostart = on". This will force Xdebug to start a debug session for every request that is done on this server, without having to specify in the request that a debug session is wanted.

    You need change

    "xdebug.remote_autostart = off"

    And restart web service. In this example is Apache.

    You can read more here: http://doc.waterproof.fr/phpedit/debugging_profiling/configuration/debugger_with_xdebug

    GoodLuck!

    0 讨论(0)
提交回复
热议问题