Jump to content

debugger for php


Recommended Posts

I downloaded only xdebug module which is non thread safe and whose name is php_xdebug-2.1.2-5.2-vc6 . My php is vc6 version 5.2 and apache is 2.2 . I tried to configure xdebug in my php.ini file like this :


zend_extension="C:\Program Files\PHP\php_xdebug-2.1.2-5.2-vc6.dll"


save then restarted Apache , looked my php info but I could not see xdebug module .


any help ?

Link to comment
Share on other sites

"Check the error log for messages why it couldn't load the extension"


display_errors = On //uncommented

log_errors = On //uncommented

display_startup_errors = On //uncommented

error_reporting = E_ALL //uncommented


There is no error in the error log concerning why the module could not be load


And now ???!!

Edited by hisoka
Link to comment
Share on other sites

hello Justsomeguy . I followed the link and it asked me to submit to a form and I did so . This is what I got as a result :


Tailored Installation Instructions


Xdebug installed: no
Server API: Command Line Interface
Windows: yes - Compiler: MS VC9 - Architecture: x86
Zend Server: no
PHP Version: 5.2.9-2
Zend API nr: 220060519
PHP API nr: 20060613
Debug Build: no
Thread Safe Build: yes
Configuration File Path: C:\WINDOWS
Configuration File: C:\Program Files\PHP\php.ini
Extensions directory: C:\Program Files\PHP\ext

PHP versions below 5.4 are not supported


So , based on these information , what should I do now ??

Link to comment
Share on other sites

Problem solved thanks to you justsomeguy . Xdebug is working and showing errors and it is shown in the php info . But the errors Xdebug shows do not reflect the real errors made in the code . For example


I tried with this little php code :


<?php ech "well" ; ?>


The error xDebug shew is :


( ! ) Parse error: syntax error, unexpected '"good"' (T_CONSTANT_ENCAPSED_STRING) in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\a.php on line 3


When I see an error like that , I will never figure out that the error is in "ech" which should be "echo" . Plus the content of the error itself that XDebug gives is somehow unclear for a newbie like me which make the ability to understand the error and then correct it very difficult especially with expressions like T_CONSTANT_ENCAPSED_STRING or ${ (T_DOLLAR_OPEN_CURLY_BRACES) or {$ (T_CURLY_OPEN) ( in an other error context )


So I said may be it is good idea to implement an IDE with xdebug like DEV PHP so that , may be through an IDE , errors become more obvious to understand and avoid . What do you think justsomeguy ?

Edited by hisoka
Link to comment
Share on other sites

XDebug can integrate with several IDEs, such as PHPStorm. If you're asking for error messages that specifically say what you did wrong, PHP doesn't know what you did wrong. It doesn't know that you meant to write "echo". All it sees is a constant followed by a string. That error message doesn't match the line of code you wrote, but you should be able to see that and understand that it didn't expect the string and then figure out why. The first thing you should check in that case is to look at what is right before the string.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...