Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45335 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50255 invoked from network); 22 Aug 2009 19:11:53 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Aug 2009 19:11:53 -0000 Authentication-Results: pb1.pair.com smtp.mail=dreamcat4@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dreamcat4@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.218.226 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: dreamcat4@gmail.com X-Host-Fingerprint: 209.85.218.226 mail-bw0-f226.google.com Received: from [209.85.218.226] ([209.85.218.226:40861] helo=mail-bw0-f226.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C2/1E-03363-7F2409A4 for ; Sat, 22 Aug 2009 15:11:52 -0400 Received: by bwz26 with SMTP id 26so875424bwz.23 for ; Sat, 22 Aug 2009 12:11:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:from:date:message-id :subject:to:content-type:content-transfer-encoding; bh=Ff2ehFyM7GMtaiViG9qg8FZ2VSMq7L8zM7G/vWhXwpA=; b=AEpZt2uSuEgnoeFZ/oK9ixxxaumtKXgCTE254HCzZxKT7nZT89Gl/oR2VevRFwJvH7 CApBz7cKKBIFInb23M9YPsovc8p+IWTO/1OFmmdvuNp+w/rO5I/D4mVgxJwgDIeyiECA XJRdVGqboRyO4c9XNjHTX4qCs3KuaMjX5jl6c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:content-type :content-transfer-encoding; b=NI5MFMSDJAow+CnoVanWDchTzLN4zdwLypQfHDn57oLOb+7fPh+b7bXucab/rFSupP mNJu+eBgPV2uKDDFELMIwZBQ0Zog/QMew20aCr5VGtH7df6xagqtxlkUtycXTkjoXo+b LX6jD+s6ofd5mT2HEW/uT3sjfrR/dnd59txUY= MIME-Version: 1.0 Received: by 10.239.163.199 with SMTP id q7mr267639hbd.29.1250968308062; Sat, 22 Aug 2009 12:11:48 -0700 (PDT) Date: Sat, 22 Aug 2009 20:11:28 +0100 Message-ID: <99cf22520908221211j29ce7579qe12c8f84eff67527@mail.gmail.com> To: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: (SAPI) New php variant - refuses to load Zend extensions From: dreamcat4@gmail.com (dreamcat four) 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! 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: 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 dreamcat4@gmail.com