Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46759 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 25639 invoked from network); 17 Jan 2010 00:25:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jan 2010 00:25:16 -0000 Authentication-Results: pb1.pair.com header.from=rwe_rt@yahoo.com; sender-id=unknown; domainkeys=good Authentication-Results: pb1.pair.com smtp.mail=rwe_rt@yahoo.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain yahoo.com from 66.196.97.66 cause and error) DomainKey-Status: good X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: rwe_rt@yahoo.com X-Host-Fingerprint: 66.196.97.66 web56707.mail.re3.yahoo.com Received: from [66.196.97.66] ([66.196.97.66:20269] helo=web56707.mail.re3.yahoo.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 05/60-27028-AE8525B4 for ; Sat, 16 Jan 2010 19:25:15 -0500 Received: (qmail 34130 invoked by uid 60001); 17 Jan 2010 00:25:12 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1263687912; bh=Yqd7aa4KHJR3K92vrJoE8A4oSVMaicakMdBU/ylbBhQ=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=3AfG/U0IPRW0NK4sAvq95XZs6y9wXrvQOlII4oRJTLmNfepxgwJf2FtcpHdLCKeX1WGwXvnmSm71vaSdRZ2WRmQ9dXUqjJEfBCMHAgjZeqKItwVvV2lCd5zOLHrZHfafSVlzyduroXzInThqP/5aqkFYlv3j/4cmVKIfOYiIn78= DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=v3uXEkZ9pLQAUX7jjJ7wQmL1pet4fruNENNjnzc3ymvrhYFgLETjJDgRij8WvEoA2Fs4mXuR/6l0xyU3B7X+fwvE/zlm/Zw1gKcbdUBp7iwTiIqPKf+SXgJ9LNl2AUeK4Tc/UTXgk28BBdzjmhWYAphJ6bGuq+EJ2w0aoz6m4WM=; Message-ID: <134308.42725.qm@web56707.mail.re3.yahoo.com> X-YMail-OSG: CYcgHkYVM1m.XyLDQdgo0_oj9JnGIiTF9QgmqYTZCpMG78nqeicUxZLYq6ltWWLFK3lseXohN.7rAvhsIOuASBc3EFfSGh73xqHaRSmbL.oqFNIfd1DZxcdVVV40_8ueSt0fiITSCFvWgcIMD_CDX7zJcVFcRRJQInO5GCTxrVaph5YHZqGLwPQCXx_5vYjJ7Q.TJoTNuvndrcvuKdqO4YeS344pPwbwXbkWdw47DBE1U1lnEJZm1rwRkFsvuhw.WoqyNItDYKI9ZeK69lP0ooFHHPFCtEfXYh5a..PEHEZSEK_RE6YuvqJ4ho2eSJBPnDxuDPsN_8znibbVPGX4KEo7mu0byH9K.u7cE36RwtvStxbAwtQb4H.X3OYnS9.qKb5QSChEmiakD0Rh9K2iMSTGH17njKH6Ji2UtWxW1B6H2yHXwLKRv8CShicpFEIqlcBXAA-- Received: from [76.65.159.232] by web56707.mail.re3.yahoo.com via HTTP; Sat, 16 Jan 2010 16:25:12 PST X-Mailer: YahooMailClassic/9.0.20 YahooMailWebService/0.8.100.260964 Date: Sat, 16 Jan 2010 16:25:12 -0800 (PST) To: internals@lists.php.net MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-916774909-1263687912=:42725" Subject: Can we call Apache 2 API function from a PHP 5 extension module? From: rwe_rt@yahoo.com (rwe rt) --0-916774909-1263687912=:42725 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hi all,I compiled php-5.3.1 with apache 2.2.14 as DSO and wanted to test ho= w to call Apache API from=A0a PHP module:Run ./ext_skel --extname=3DhelloMo= dified ext/hello.c and the function PHP_FUNCTION(confirm_hello_compiled) so= that it contains #include "SAPI.h" #include "httpd.h" #include "http_config.h" #include "http_protocol.h" #include "ap_config.h" request_rec *hello_r;PHP_FUNCTION(confirm_hello_compiled) { hello_r =3D (re= quest_rec *)SG(server_context); ap_rprintf(hello_r, "Hello world\n");=A0 = =A0 return SUCCESS; }Under php root, run ./buildconf and ./configure --with-apxs=3D/home/www/bi= n/apxs --enable-helloIt worked fine. But when I furhter ran: makeI got an error like:....ext/hello/.libs/hello.o: In function=A0zif_conf= irm_hello_compiled': /home/www/php-5.3.1/ext/hello/hello.c:167: undefined r= eference toap_rprintf'near the end of compiling.As far as I know, PHP 5 can= only be compiled as DSO and don't have access to compiled objects in Apach= e 2 directly. How to modify config.m4 or other files so that I can make com= piling successful?=A0Any help would be greatly appreciated!Rwe=0A=0A=0A = __________________________________________________________________=0ABe s= marter than spam. See how smart SpamGuard is at giving junk email the boot = with the All-new Yahoo! Mail. Click on Options in Mail and switch to New M= ail today or register for free at http://mail.yahoo.ca --0-916774909-1263687912=:42725--