Re: How to integrate PHP with my homegrown server
| From: | BuildSmart | Date: | Fri, 24 Aug 2007 17:53:51 +0000 |
| Subject: | Re: How to integrate PHP with my homegrown server | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-31904@lists.php.net to get a copy of this message | ||
-----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: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).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: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.http://some.server.com/mypage.php?parm1=Hello&parm2=Goodbyeand 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?
Cheers, Rob.- -- BuildSmart -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (Darwin) iD8DBQFGzxsv0hzWbkf0eKgRAvb6AKCqlvNucj+YQtnEyENYbwkAKMCnTQCbBDSF CGhKu8kbc2OQy8CTsLlN+kY= =C7+d -----END PGP SIGNATURE-----