File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Java Products and Servers and the fly likes PHP/CGI how to make it work under Resin standalone? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Other Java Products and Servers
Bookmark "PHP/CGI how to make it work under Resin standalone?" Watch "PHP/CGI how to make it work under Resin standalone?" New topic
Author

PHP/CGI how to make it work under Resin standalone?

David Yutzy
tumbleweed and gunslinger
Ranch Hand

Joined: Jun 29, 2001
Posts: 192
I've read on the Caucho site about various people trying to get PHP and CGI to work under Resin and use something called "FastCGI" within Resin to get it working.
I've also tweaked some code to get PHP and CGI working on a RedHat box, but the same code doesn't work on Windows at all.
Have anyone got this to work, if so, could yo post what I need to get it working under Resin?
The main push for me is I would like to run Resin as my sole web server, rather than having Apache handle PHP/CGI and Resin Java.
I don't have the bandwidth nor need to have to deal with two web servers.
I do a lot of side projects and virtual hosting causes me to have to setup Apache as well as Resin to handle the differing requests.
Matthew Phillips
Ranch Hand

Joined: Mar 09, 2001
Posts: 2676
Take a look at this from the php website.


Matthew Phillips
Scott Ferguson
Greenhorn

Joined: Sep 26, 2002
Posts: 5
You may or may not want to use that method; that's why Resin has FastCGI support. If you look at that page, you'll see that PHP calls chdir(), which may or may not mess up your server depending on whether you use File() and FileInputStream() assuming the current directory.
The FastCGI requires you to compile PHP with something like --fast-cgi as a ./configure option. Then you also need a launching program to get it to listen to the proper port. On Unix, Resin has as bin/fastcgirunner.pl script which will launch it.
Then you can use Resin's FastCGIServlet to connect to the PHP process.
Yes, it's a little more involved to set that up. If you don't care about performance, you can also just use the CGIServlet to invoke PHP as a normal CGI.
David Yutzy
tumbleweed and gunslinger
Ranch Hand

Joined: Jun 29, 2001
Posts: 192
So just create a servlet mapping pointing *.php to CGIServlet?
 
 
subject: PHP/CGI how to make it work under Resin standalone?