Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:31898 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5317 invoked by uid 1010); 24 Aug 2007 15:22:20 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 5302 invoked from network); 24 Aug 2007 15:22:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Aug 2007 15:22:20 -0000 Authentication-Results: pb1.pair.com header.from=robert@interjinn.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=robert@interjinn.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain interjinn.com from 66.11.173.122 cause and error) X-PHP-List-Original-Sender: robert@interjinn.com X-Host-Fingerprint: 66.11.173.122 unknown Linux 2.5 (sometimes 2.4) (4) Received: from [66.11.173.122] ([66.11.173.122:60997] helo=blobule.interjinn.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id B3/21-31863-9A7FEC64 for ; Fri, 24 Aug 2007 11:22:19 -0400 Received: by blobule.interjinn.com (Postfix, from userid 2000) id E54335AC228; Fri, 24 Aug 2007 11:22:17 -0400 (EDT) To: Steve Francisco Cc: internals@lists.php.net In-Reply-To: References: Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: InterJinn Date: Fri, 24 Aug 2007 11:22:14 -0400 Message-ID: <1187968936.22231.14.camel@blobule> Mime-Version: 1.0 X-Mailer: Evolution 2.8.1 Subject: Re: [PHP-DEV] How to integrate PHP with my homegrown server From: robert@interjinn.com (Robert Cummings) 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. Cheers, Rob. -- ........................................................... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ...........................................................