I have a PHP extension (written in C) that calls a utility library that I wrote in C++. For my testing and debugging, I have been trying to exercise my code using PHP from the command line (‘/usr/bin/php’). For some reason, PHP dumps core (segmentation fault) when I try to use any of my functions.
Even if my php script is simply <?php phpinfo(); ?>. At this point, I’m not even calling any of my C++ utility functions, PHP_MINIT_FUNCTION(myext) and PHP_RINIT_FUNCTION(myext) are essentially no-ops, and PHP_MINFO_FUNCTION(myext) has only constant asciiz strings. My phpinfo() still dumps core.
To load my utility library, I have a config.m4 line:
PHP_EVAL_LIBLINE("-L/bjb/lib -lbjbutility")
When I comment out the ‘PHP_EVAL_LIBLINE’, the phpinfo() functions works OK.
I have used the C++ utility library for several years, outside of the context of PHP with no problems, even when calling from a C mainline.
Has anyone seen this before? Any suggestions as to what might be strategy for debugging this? Where else can I look for information that might be useful?
Thanks in advance,
Bruce
Environment information:
Php 4.3.1
Configure Command => './configure' '--target=' '--prefix=/bjb' '--with-apxs=/bjb/home/www_serv/bin/apxs' '--with-gd' '--with-zlib' '--with-zlib-dir=/home/jeb/target/bjb' '--with-jpeg' '--with-jpeg-dir=/home/jeb/target/bjb' '--with-png' '--with-png-dir=/home/jeb/target/bjb' '--with-freetype' '--with-freetype-dir=/home/jeb/target/bjb' '--with-pdflib=/home/jeb/target/bjb' '--with-enable-dba' '--with-cdb' '--with-dbm'
DEC Tru64 cxx -V DIGITAL C++ V6.1-027 on DIGITAL UNIX V4.0 (Rev. 1229)
_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php