问题
Hei helping people!
Some while ago I installed xdebug and had some trouble getting it to work — but I did.
Now I tried starting debugging again, but it wouldn't work.
If I call php -m
or phpinfo()
through the browser, it tells me that xdebug is loaded.
But when I start phpinfo() as phpscript from Eclipse, it doesn't load.
Also adding a line like xdebug_break()
it'll tell me
PHP Fatal error: Call to undefined function xdebug_break() in /home/andy/public_html/phpDebugTest/console.php on line 3
I learned that php is called from Eclipse with different include-paths, but I added the same as from php.ini to the project.
Thanks a lot for helping out!
回答1:
This happens because Eclipse PDT copies your php.ini to a temporary folder, without the contents in the relative conf.d folder (such as /etc/php5/cli/conf.d). This results in having your extensions not properly loaded. I answered this question on stackoverflow:5784327, you might check out the solution provided there.
来源:https://stackoverflow.com/questions/5887062/php-not-loading-xdebug-when-started-from-eclipse-pdt