Strange debian-mysql-apache-mod_perl problem
This got me. I was adding a new script to an already working mod_perl site, and when I found it working on my Windows box, I "released" it to the live Linux server.
It didn't work. Without getting into too much details, I could summarize what caused the problem:
use DBI;The above script nicely connects through the command line, but when loaded into the browser, it returns 0 bytes and closes the connection. If I comment out the connection line(s), the whole thing works OK from mod_perl too.
print "Content-type: text/html\n\n OK!";
print eval{
DBI->connect("DBI:mysql:database=dbname",'user','pass',
{ RaiseError => 1, PrintError => 1, AutoCommit => 1 })
};
The site's error log gets the following messages:
free(): invalid pointer 0x917cb90!Strange. Add to the frustration that the other parts of the site use the database connection without a problem.
No happy end: I moved the new function under CGI, there it works.
Sometimes I really wish I was a baker or something.

0 Comments:
Post a Comment
<< Home