On 24 Jun 2007 22:18:40 -0700, Robert Alford <the_president@xxxxxxxxxx> wrote:
List, I have a piece of Ruby code and a piece of PHP code that I would like to serve as part of one web page. My server has been setup such that it can serve Ruby and PHP pages individually, but I'm not sure if there exists the means to get Apache to interpret a block of Ruby code in the same page as a block of PHP code? As I understand it, Apache determines which interpreter to used based on the extension of the page, so I would need to start by figuring out some way to circumvent this obstacle. Various web research I've done suggests that I might be able to use proxying to get the two code modules served in one page, but I'm not sure what sort of performance penalties that would incur? The page I would like to create will be performance-sensitive, so if proxying comes at a significant time cost, it will probably not be a viable solution to me.
First things first: unless you absolutely can't avoid it, that sounds like a bad idea. Both of those languages are capable of doing pretty-much any task (with varying levels of simplicity). By combining the two, you are making an overly-complicated system which could open you up to possible security problems and certainly will be fragile. Apache 2.x is, in general, designed to handle problems like that. Many different "filters" can be run over the same output. Unfortunately, php is not designed to run as a filter; it must originate the content. I'm not sure about ruby; I suppose it depends on what method you are using to intergrate ruby into apache. A relatively clean and reliable way to do this (although probably not the most performant) would be to put (for example) the ruby code in a separate web-accessible file on the server and configure that file to be processed properly. Then have your php code grab that file via http from the server and insert it in the appropriate place in the main document. Joshua. --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx