I had the segfault problem with Redhat 6.1/mod_perl 1.2x/php 4.0RC1
Then I upgraded to PHP4.0.1pl2, and upon configuring got this little handy
message:
+--------------------------------------------------------------------+
| *** WARNING *** |
| |
| You chose to compile PHP with the built-in MySQL support. If you |
| are compiling a server module, and intend to use other server |
| modules that also use MySQL (e.g, mod_auth_mysql, PHP 3.0, |
| mod_perl) you must NOT rely on PHP's built-in MySQL support, and |
| instead build it with your local MySQL support files, by adding |
| --with-mysql=/path/to/mysql to your configure line. |
(this didn't appear when I configured any previous version of PHP)
So, I reconfigured PHP with --with-mysql=/path/to/mysql (in my case it was
/usr), recompiled, and the segfault problem disappeared.