Re: Calling PHP from Java usign CGI...
| From: | Rodrigo Reyes | Date: | Fri, 27 Jun 2003 16:11:16 +0000 |
| Subject: | Re: Calling PHP from Java usign CGI... | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-153162@lists.php.net to get a copy of this message | ||
Catalin
I am also quite new to all this. I'll tell you a bit more about what I
am trying to accomplish here. I am working on some project which has a a lot
of code written in PHP and is going to need also a lot of code in JAVA. So,
I was thinking that it would be great if we could have PHP connected to our
servlet container and web server, which is Jetty. I looked in the mailing
lists for info about this, and I found a servlet which connects (or at least
tries) to PHP using CGI (Common Gateway Interface).
The HttpURLConnection is algo a good idea. Still, it would be a lot
better if I could just connect PHP to Jetty the same way PHP connects to
Apache using CGI. Any idea on how to accomplish this? Thanx...
Rodrigo
"Catalin Trifu" <catalin@isp-software.de> wrote in message
news:20030626231702.50675.qmail@pb1.pair.com...
> Hi,
>
> I didn't quite understood what you mean by CGI in this case,
> but if you reffer to calling a script which resides on a server via HTTP
> protocol, i suggest you take a look at the java.net.* package, You can
> use the java.net.URLConnection to connect to the PHP script and act
> as a client (like a browser) for it from your servlet.
> You should het the response from the script back through the
> getInputStream()
> ar any other method that suits you.
> Also take a look at java.net.HttpURLConnection which has more
> specific methods for dealing with HTTP.
> Once again, I may have misunderstood you, but I hope this is
> helpfull anyhow.
>
> Cheers,
> Catalin
>
> "Rodrigo Reyes" <rodrigo@instaservi.com> wrote in message
> news:20030626223940.20059.qmail@pb1.pair.com...
> > Hi all
> > Has anyone been able to call php from a servlet (JAVA) using CGI
> > interface? I am trying to do that here, and everything seems to work
> without
> > problems, except that no data returns from the execution of my scripts.
> Any
> > idea what could be happening? Is there information on how to configure
the
> > CGI variables in order to be able to call PHP? Thanx in advance...
> >
> > Rodrigo
> >
> >
>
>