Talk is cheap, show me the code
I’ve just made to isntall xdebug 2.x (cvs version) substitutting xdebug 1.3 in my localhost. Previously, the xdebug compilation was not my problem. It was compiled just fine. No error at all. But when I try to use it as a module, php -v will throw up and error that module can not be loaded for undefined symbol: zend_throw_error_exception.
I was on a a good mood so I took a peek in /usr/include/php/Zend/zend_exception.h. Voila, as what I’ve expected, zend_throw_error_exception was not defined there. A little hack did fine. Below, I replaced the zend_throw_error_exception to zend_throw_exception. Remove extra param, re-comple, and voila. It’s loadable now :).
/* throw an exception if we are in EH_THROW mode
* but DO NOT overwrite a pending exception
*/
if (PG(error_handling) == EH_THROW && !EG(exception)) {
//zend_throw_error_exception(PG(exception_class), buffer, 0, type TSRMLS_CC);
zend_throw_exception(PG(exception_class), buffer, type TSRMLS_CC);
}
This section gives me most headache. But experience told me that this blog mostly contains personal ramblings related to daily life, open source, and web 2.0. Recently, it turns out to be an idea-box where you can found ideas you can execute in your new startup ;). My ideas and opinions are not bullet proof and never intended to be one way stream. Kindly participate to improve your and my perspective regarding any particular post. Welcome aboard and enjoy your stay
Samuel
October 6th, 2006 at 2:23 pm
Yes, zend_throw_error_exception seems to only exist in 5.1.x and latter, not 5.0.x
But i think the patch is better this way :
zend_throw_exception(PG(exception_class), buffer, 0 TSRMLS_CC);
because this is the way it is done in main.c of PHP5.0.x
toni
October 6th, 2006 at 6:43 pm
Cool, Now everyone can properly patch it. I was patching in blind, by referring to the .h file.
Say, how’s XDebug feel in PHP 5.2.x? I’m using PHP 5.2.x now but I have’t download the news XDebug version.