mod_ruby breaks php

C

Curt Sampson

I'm having a very odd problem. My software:

Apache 2.0.53
PHP 4.3.10
mod_ruby 1.2.4

(I'm just now upgrading PHP to 4.3.11 to test again.)

It seems that if I run a script using mod_ruby, php mysteriously starts
breaking. I'm not sure at the moment where or how, but my web tests
(which set up a server, send HTTP requests to it, and examine the
results) all run fine if I don't run any ruby scripts; even running an
empty one will cause PHP code to start failing.

I'm going to see if I can come up with a repeatable test case for this,
but in the meantime, has anybody else ever seen anything like this? Are
there any mod_ruby gurus out there who could help me out with this?

cjs
 
C

Curt Sampson

Well, if anybody's curious, the reason that my PHP code broke after
running a mod_ruby script is that PHP doesn't touch the environment,
but mod_ruby replaces the environment with what would be provided to a
CGI script. My PHP stuff for getting a database connection relied on an
environment variable to supply the schema name, and so after running a
ruby script during testing, it would in the future connect to the wrong
database schema, giving me bogus information.

Adding a SetEnv directive to my http config ensured that the variable
is passed. However, it's arguably a bug that mod_ruby does not restore
the environment when it's finished processing a request, so that other
modules see apache's original environment rather than mod_ruby's
modified one.

cjs
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,819
Latest member
masterdaster

Latest Threads

Top