php eclipse debugging

7.1k Views Asked by At

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

3

There are 3 best solutions below

0
On

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).

1
On

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)

0
On

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:

enter image description here