Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:46765 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 99320 invoked from network); 17 Jan 2010 09:27:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jan 2010 09:27:55 -0000 Authentication-Results: pb1.pair.com smtp.mail=tyra3l@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=tyra3l@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.227 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: tyra3l@gmail.com X-Host-Fingerprint: 209.85.220.227 mail-fx0-f227.google.com Received: from [209.85.220.227] ([209.85.220.227:34689] helo=mail-fx0-f227.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 04/D9-27028-918D25B4 for ; Sun, 17 Jan 2010 04:27:54 -0500 Received: by fxm27 with SMTP id 27so1393474fxm.23 for ; Sun, 17 Jan 2010 01:27:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=tP666jXZFHfRb0T+SKC7TSpbTDNG3fpGvHtQVNTBqjs=; b=HvRWU66n0mlCFjNeyLo5cmNy+FOqVW2+Cden5QtV1xvpzHTedVnv7+a0MRJ8AkJ3jx MH0lfPjim4vMbGleCgbvlTb6EaKezIgMrrXoubX+nUG8/i23P+7rTpmFsXHjr0n2Tc8e m/fzNU6dDacPPIet8DQND/RoWU4DLDR7Orcd8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=V6MnfcbZAq/OwuayGP0L/wqkmaA37p5LkS1G5RIMBa79fX5+n6p975Up639zLghz4a kJJyS5LBWJ3PNXiEF2WhvE5Fa5P7Xx1uu4zI8QSr6uOxsJdCuWnis58GqGTQE4Ds5CE7 U/aCXU/1GSxm0X71lpulfKyJnclcpr3IH7mA4= MIME-Version: 1.0 Received: by 10.239.191.203 with SMTP id c11mr471799hbi.65.1263720470170; Sun, 17 Jan 2010 01:27:50 -0800 (PST) In-Reply-To: References: <134308.42725.qm@web56707.mail.re3.yahoo.com> Date: Sun, 17 Jan 2010 10:27:50 +0100 Message-ID: To: mm w <0xcafefeed@gmail.com> Cc: "Brian J. France" , rwe rt , internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Can we call Apache 2 API function from a PHP 5 extension module? From: tyra3l@gmail.com (Ferenc Kovacs) You are just trolling again, or do you have some solution/suggestion for the original problem? Tyrael On Sun, Jan 17, 2010 at 7:35 AM, mm w <0xcafefeed@gmail.com> wrote: > yep nevermind I don't you post this question on php-internal and don't > understand this ugly suggestion, Brian when I read your cv it seems to > be something serious ... when I see the line with your type recasting > I am not sure you understood something during these 15 =C2=A0years. > > Best > > On Sat, Jan 16, 2010 at 10:05 PM, Brian J. France = wrote: >> Try this instead: >> >> request_rec *r =3D (request_rec *)(((SG(server_context) =3D=3D NULL) ? N= ULL : ((php_struct*)SG(server_context))->r)); >> >> Apache 2.x server_context is not a request_rec, it is a struct with a re= quest rec in it. >> >> Brian >> >> >> On Jan 16, 2010, at 7:25 PM, rwe rt wrote: >> >>> Hi all,I compiled php-5.3.1 with apache 2.2.14 as DSO and wanted to tes= t how to call Apache API from a PHP module:Run ./ext_skel --extname=3Dhello= Modified 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= (request_rec *)SG(server_context); ap_rprintf(hello_r, "Hello world\n"); = =C2=A0 =C2=A0return SUCCESS; >>> }Under php root, run ./buildconf and ./configure --with-apxs=3D/home/ww= w/bin/apxs --enable-helloIt worked fine. But when I furhter ran: >>> >>> makeI got an error like:....ext/hello/.libs/hello.o: In function zif_co= nfirm_hello_compiled': /home/www/php-5.3.1/ext/hello/hello.c:167: undefined= reference toap_rprintf'near the end of compiling.As far as I know, PHP 5 c= an only be compiled as DSO and don't have access to compiled objects in Apa= che 2 directly. How to modify config.m4 or other files so that I can make c= ompiling successful? Any help would be greatly appreciated!Rwe >>> >>> >>> =C2=A0 =C2=A0 =C2=A0___________________________________________________= _______________ >>> Be smarter than spam. See how smart SpamGuard is at giving junk email t= he boot with the All-new Yahoo! Mail. =C2=A0Click on Options in Mail and sw= itch to New Mail today or register for free at http://mail.yahoo.ca >> >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > >