Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31904 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78097 invoked by uid 1010); 24 Aug 2007 17:53:57 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 78082 invoked from network); 24 Aug 2007 17:53:57 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Aug 2007 17:53:57 -0000 Authentication-Results: pb1.pair.com header.from=buildsmart@daleenterprise.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=buildsmart@daleenterprise.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain daleenterprise.com from 67.78.11.229 cause and error) X-PHP-List-Original-Sender: buildsmart@daleenterprise.com X-Host-Fingerprint: 67.78.11.229 daleenterprise.com Received: from [67.78.11.229] ([67.78.11.229:57519] helo=daleenterprise.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 06/AC-31863-43B1FC64 for ; Fri, 24 Aug 2007 13:53:57 -0400 Received: from localhost (localhost [127.0.0.1]) by daleenterprise.com (Postfix) with ESMTP id 8B79A1FCFCB; Fri, 24 Aug 2007 13:53:54 -0400 (EDT) Received: from daleenterprise.com ([127.0.0.1]) by localhost (daleenterprise.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 27237-20; Fri, 24 Aug 2007 13:53:52 -0400 (EDT) Received: from [10.1.100.11] (daleenterprise.com [10.1.100.11]) by daleenterprise.com (Postfix) with ESMTP id D18661FCFC1; Fri, 24 Aug 2007 13:53:52 -0400 (EDT) In-Reply-To: <1187968936.22231.14.camel@blobule> References: <1187968936.22231.14.camel@blobule> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-ID: <81A204AC-F811-4358-8118-ED2F54C01672@daleenterprise.com> Cc: Steve Francisco , Robert Cummings Content-Transfer-Encoding: 7bit Date: Fri, 24 Aug 2007 13:53:51 -0400 To: PHP Developers Mailing List X-Pgp-Agent: GPGMail 1.1.2 (Tiger) X-Mailer: Apple Mail (2.752.2) MTA-Interface: amavisd-new-2.3.3 (2005-08-22) + Maia Mailguard 1.1.0 at daleenterprise.com X-Spam-Scanned: using SpamAssassin 3.1.7 (2006-10-05) at daleenterprise.com X-Virus-Scanned: using ClamAV 0.88.6 (2006-11-05) at daleenterprise.com Subject: Re: [PHP-DEV] How to integrate PHP with my homegrown server From: buildsmart@daleenterprise.com (BuildSmart) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Aug 24, 2007, at 11:22:14, Robert Cummings wrote: > On Fri, 2007-08-24 at 11:08 -0400, Steve Francisco wrote: >> Hi, as an experiment I have a simple Java based server that >> listens on >> port 80 and can serve files just fine. I'd like to extend it to >> support >> PHP but am looking for guidance on how to do that. Can someone >> point me >> to instructions? >> >> My first attempt was to just call the php.exe command line >> interface to >> launch the php interpreter, capture the html and send it back to the >> caller. That works well, but I can't seem to figure out how to deal >> with parameters. For example, if the url would be this on the >> server: >> http://some.server.com/mypage.php?parm1=Hello&parm2=Goodbye >> and in mypage.php I do something like this: >> $echo $_GET["parm1"]; >> then how do I test this via the PHP command line? >> >> If the command line doesn't have a way to cause $_GET to be >> populated, >> then what other way of invoking PHP could I use? > > Sounds like you might need some glue. Have your PHP script run a > function that synchs up the globals with what you want. So your Java > server could populate a file or something with the appropriate data > that > it received and your glue function would read it and populate the > global > arrays. Would it not be easier to build php as a cgid? You can look at the source in lighttpd, it shows an simple method to interface with the php cgid which I think you could incorporate into your java server (unless your java server is all script based then it might take a little more work). > > Cheers, > Rob. - -- BuildSmart -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (Darwin) iD8DBQFGzxsv0hzWbkf0eKgRAvb6AKCqlvNucj+YQtnEyENYbwkAKMCnTQCbBDSF CGhKu8kbc2OQy8CTsLlN+kY= =C7+d -----END PGP SIGNATURE-----