php eclipse debugging

二次信任 提交于 2019-12-06 04:35:29

问题


I am runing a php script using eclipse. when a set breakpoint and run the script it throws me this error.

form the error it is apparent that i have change something the php.ini file. but i dont know what i have to change to make either zend or xdebug. even i dont know what the differnce b/w them.

following the error

The session could not be started. In order to generate debug information, please make sure that the debugger is properly configured as a php.ini directive


回答1:


I ran into this error also, and my issue turned out to be a misconfiguration of Eclipse. In Eclipse, I had configured (in Windows > Preferences) the "PHP Executables", but I had not configured the PHP "Debug" settings. In PHP "Debug", I had to set "PHP Debugger" to XDebug (mine was set to "Zend Debugger"). I also had to set the "PHP Executable" and toggle the "Enable CLI Debug". I wrote a BLOG post about this (with some screen shots).




回答2:


It's impossible to answer this without more information about your specific setup. Xdebug has some set-up documentation here which may get you started.

The reference manual for xdebug's configuration settings (i.e. the lines you would want to put into your php.ini) can be found over here.

i dont know what i have to change to make either zend or xdebug. even i dont know what the differnce b/w them.

Xdebug is a PHP extension, the zend framework is a ...well, a framework. They are completely unrelated. You don't have to change anything in zend-framework's configuration in order to get xdebug up and running. Your problem is just a PHP(.ini) thing.

Additional Note: If your PHP installation is on Windows, this page might help you a lot. (at least it claims to show you "how to configure PHP to get Xdebug running" - I haven't tested it, I don't run Windows)




回答3:


To solve this issue we need to go to the windows=>preferences and type PHP. There you can find PHP Executables and add

Name: php
Executable path: path you installed PHP (ex: C:\php\php.exe)
PHP ini file: C:\php\php.ini
SAPI Type: CLI
PHP debugger: Zend Debugger to Xdebug

See the screenshot below:



来源:https://stackoverflow.com/questions/3487122/php-eclipse-debugging

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