Hello,
Working on php-cgi variant PHP-FPM 0.6.0.
Link: http://dreamcat4.jottit.com/new_php5-fpm_testing_candidate

The resulting FPM binary works BUT refuses to load Zend extensions. Oh
- so close!

dreamc...@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:
function_add_ref
PHP Warning:  PHP Startup: Unable to load dynamic library
'/usr/lib/php5/20060613+lfs/pdo.so' -
/usr/lib/php5/20060613+lfs/pdo.so: undefined symbol:
zend_objects_store_add_ref in Unknown on line 0
 done

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
sapi/cgi/getopt.lo main/internal_functions.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_OBJS="$PHP_GLOBAL_OBJS main/internal_functions.lo"

php_fpm_LDADD = \
        $(PHP_OBJS:%=$(PHP_BUILDDIR)/%) \
        sapi/libsapi.la \
        fpm/libfpm.la \
        ../libevent/libevent.la \
        $(php_fpm_ADD_LIBS)

libsapi_la_SOURCES = \
        cgi_main.c \
        fastcgi.c \
        getopt.c


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?



dreamcat4
dreamc...@gmail.com

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to