PHP in Rails app running on WEBRick

Hi all,

I’ve got a Rails app, and I’ve been asked to include some PHP pages in
the site. They don’t need to interact with the Rails app itself (I’d
treat them much like GIF files), but I’d still like to be able to
access them at development time using WEBRick.

What do I need to add to ./script/server to support PHP pages?

Cheers,
Douglas

Hi Douglas,

WEBRick is just for serving ruby, but you can have another server
serving php. By default WEBrick runs on port 3000 so you could serve
your php files with apache on port 80 in development.

If you are developing on windows you can use InstantRails which is a
self contained package with rails, php, mysql and apache. It doesn’t
install anything to your system, you just start it and go, there is a
folder for php and other html files and php files to run on apache and
a rails folder your rails app to run on WEBrick. For deployment you
will need a server that can run both your rails app and php, but for
development this is the setup that I have and it works great.

I hope this helps,
Jake

I use lighttpd to host both Rails and PHP files with FastCGI. My config
looks something like this:

fastcgi.server = (
“.fcgi” =>
( “localhost” =>
(
“socket” => var.socket,
“bin-path” => var.binpath,
“bin-copy-environment” => (
“PATH”, “SHELL”, “USER”
),
“bin-environment” =>
(
“RAILS_ENV” => var.railsenvironment,
“PATH” =>
“/usr/local/bin:/sbin:/usr/local/sbin:/usr/sbin:/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin”
),
“min-procs” => 1,
“max-procs” => 2,
“idle-timeout” => 60

    )
),

".php" =>
  ( "localhost" =>
     ( "socket" => var.path + "lighttpd/php-fcgi.socket",
       "bin-path" => "/usr/bin/php-fcgi-441"
     )
  )

)

On 7/29/06, Jake J. [email protected] wrote:

folder for php and other html files and php files to run on apache and

I’ve got a Rails app, and I’ve been asked to include some PHP pages in
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails


Kind regards,

Nathaniel B.
President & CEO
Inimit Innovations Inc. - http://inimit.com

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs