• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
tumbleweed and gunslinger
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Take a look at this from the php website.
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 192
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So just create a servlet mapping pointing *.php to CGIServlet?
 
Everybody's invited. Even this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic