Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:45253 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 89034 invoked from network); 9 Aug 2009 21:04:29 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Aug 2009 21:04:29 -0000 Authentication-Results: pb1.pair.com smtp.mail=scott@macvicar.net; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=scott@macvicar.net; sender-id=unknown Received-SPF: error (pb1.pair.com: domain macvicar.net from 97.107.131.220 cause and error) X-PHP-List-Original-Sender: scott@macvicar.net X-Host-Fingerprint: 97.107.131.220 whisky.macvicar.net Linux 2.6 Received: from [97.107.131.220] ([97.107.131.220:42420] helo=whisky.macvicar.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 11/66-55947-CD93F7A4 for ; Sun, 09 Aug 2009 17:04:28 -0400 Received: from host0.msm.che.vodafone (host212-183-132-39.uk.access.vodafone.net [212.183.132.39]) by whisky.macvicar.net (Postfix) with ESMTP id 30C7C4695E; Sun, 9 Aug 2009 17:04:08 -0400 (EDT) Cc: Paul Biggar , thomas@koch.ro, internals@lists.php.net Message-ID: <69EC59F0-D83A-45FC-A79F-2D83BCDB7B7B@macvicar.net> To: Farley Knight In-Reply-To: Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v935.3) Date: Sun, 9 Aug 2009 23:04:05 +0200 References: <200907132215.10768.thomas@koch.ro> X-Mailer: Apple Mail (2.935.3) Subject: Re: [PHP-DEV] Can't use embeded sapi From: scott@macvicar.net (Scott MacVicar) On 9 Aug 2009, at 22:52, Farley Knight wrote: > On Mon, Jul 13, 2009 at 7:17 PM, Paul Biggar > wrote: >> Hi Thomas, >> >> On Mon, Jul 13, 2009 at 9:15 PM, Thomas Koch wrote: >>> gcc -c -I/usr/local/include/php/ -I/usr/local/include/php/main - >>> I/usr/local/include/php/Zend -I/usr/local/include/php/TSRM -Wall - >>> g -o >>> worker.o worker.c >>> gcc -L/usr/local/lib -lphp5 -o worker worker.o >>> worker.o: In function `main': >>> /var/checkouts/gearman-php-worker/worker.c:5: undefined reference to >>> `php_embed_init' >>> /var/checkouts/gearman-php-worker/worker.c:6: undefined reference to >>> `php_embed_shutdown' >>> collect2: ld returned 1 exit status >>> make: *** [all] Error 1 >> >> This worked for me, with your commands and program. Since its a >> linker >> error, it seems likely that you haven't installed libphp5.so >> properly. >> You didn't indicate that you ran make install, did you? If so, you >> may >> want to verify that there is a libphp5.so in /usr/local/lib, and that >> it is a shared library. >> >> > > I don't think Thomas is completely off here.. For most of the morning > I've been trying to compile 5.3.0: > > make clean; ./configure --enable-embed=shared; make && sudo make > install > > But when I went to build > > #include > > int main(int argc, char *argv[]) { > PHP_EMBED_START_BLOCK(argc, argv); > PHP_EMBED_END_BLOCK(); > > return 0; > } > > using > > gcc -o embed_test embed_test.c -I/usr/local/include/php/ > -I/usr/local/include/php/main -I/usr/local/include/php/Zend > -I/usr/local/include/php/TSRM -L/usr/local/lib -lphp5 > > I kept getting > > /tmp/cc9OgNuw.o: In function `main': > embed_test.c:(.text+0x21): undefined reference to `php_embed_init' > embed_test.c:(.text+0x65): undefined reference to `php_embed_shutdown' > > However, when I run config and make for 5.2.10, the test file compiles > just fine. Something must have changed between the two versions... Not > sure what, though.. Probably will dig deeper into this.. > > This fixed in SVN already, the visibility for the two functions stopped them being exposed in the library. Scott