Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:44946 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 298 invoked from network); 13 Jul 2009 20:15:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Jul 2009 20:15:27 -0000 Authentication-Results: pb1.pair.com header.from=thomas@koch.ro; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=thomas@koch.ro; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain koch.ro from 93.90.184.107 cause and error) X-PHP-List-Original-Sender: thomas@koch.ro X-Host-Fingerprint: 93.90.184.107 koch.ro Linux 2.6 Received: from [93.90.184.107] ([93.90.184.107:42473] helo=ve825703057.providerbox.net) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 12/22-24812-DD59B5A4 for ; Mon, 13 Jul 2009 16:15:26 -0400 Received: from 60-90.78-83.cust.bluewin.ch ([83.78.90.60] helo=jona.localnet) by ve825703057.providerbox.net with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.69) (envelope-from ) id 1MQRvj-00028I-GU for internals@lists.php.net; Mon, 13 Jul 2009 22:15:19 +0200 Reply-To: thomas@koch.ro To: internals@lists.php.net Date: Mon, 13 Jul 2009 22:15:10 +0200 User-Agent: KMail/1.11.4 (Linux/2.6.29-1-amd64; KDE/4.2.4; x86_64; ; ) MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-ID: <200907132215.10768.thomas@koch.ro> Subject: Can't use embeded sapi From: thomas@koch.ro (Thomas Koch) Sorry for being a C newby. Could you please help me? I try to follow Sarah's extending PHP book and fail to use the embeded PHP sapi: I compile PHP5.3: ./configure --enable-embed have a c "program": #include int main(int argc, char *argv[]) { PHP_EMBED_START_BLOCK(argc,argv) PHP_EMBED_END_BLOCK() return 0; } and a makefile: CC=gcc CFLAGS=-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 LDFLAGS=-L/usr/local/lib -lphp5 all: worker.c $(CC) -o worker.o worker.c $(CFLAGS) $(CC) -o worker worker.o $(LDFLAGS) and get after running make: 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 Thomas Koch, http://www.koch.ro