Working on php-cgi variant PHP-FPM 0.6.0.
The resulting FPM binary works BUT refuses to load Zend extensions. Oh
- so close!
dreamcat4@ubuntu910server:/usr/local/src/play/f$ sudo /etc/init.d/php5-fpm start
Starting php_fpm Failed loading /usr/lib/php5/20060613+lfs/xcache.so:
/usr/lib/php5/20060613+lfs/xcache.so: undefined symbol:
PHP Warning: PHP Startup: Unable to load dynamic library
/usr/lib/php5/20060613+lfs/pdo.so: undefined symbol:
zend_objects_store_add_ref in Unknown on line 0
Having discounted the usual suspects (pdo=shared, wrong php-api, etc)
Im left examining how the Zend sourcecode. PHP is being compiled
separartely and THEN integrated into the FPM program. The author took
a novel approach for the FPM project and is linking PHP_GLOBAL_OBJS
(all the built php object files)... then adding in his FPM part during
the link stage. The FPM code replaces what would otherwise be the
FastCGI part of PHP. BUT he must also replace the SAPI with his own
modified / tweaked SAPI...
Bear with me please. It seems the SAPI is loading Zend extensions
which is why i must ask:
In PHP build, the build target of SAPI is like this:
PHP_SAPI_OBJS = sapi/cgi/fastcgi.lo sapi/cgi/cgi_main.lo
Why is main/internal_functions.c specified in PHP as a SAPI object ?
Are any files included by internal_functions.c referencing back to
SAPI? The FPM author did include that internal_functions.lo in the
linking, but he didn't compiled it again himself, (unlike the three
other SAPI '.c' files).
FPM Makefiles looks like this:
PHP_GLOBAL_OBJS=`grep "^PHP_GLOBAL_OBJS =" $PHP_BUILDDIR/Makefile |
sed -e 's,.*= ,,'`
php_fpm_LDADD = \
libsapi_la_SOURCES = \
Going back to the original error, I am hopefully correct to be
assuming that "function_add_ref" is the Module Initialization Function
(MINIT) for XCache. So how does PHP find the name of a (MINIT) that it
should run? And after obtaining the name of the MINIT, why can't the
dynamic linker program resolve to the address? In other words - why
choke *after* finding the name of the MINIT function and not before?
Not much clues here which is why its beginning to feel like a dead end
now. Maybe theres something else I can try?