After compiling Apache 1.3.31 statically with mod_perl-1.29 and with PHP 4.3.8 as a DSO on Fedora Core 2, mod_perl segfaults when PHP is loaded but behaves itself when mod_php4 is disabled. After trawling Google extensively I found this advice regarding re-compiling Perl:

http://www.zend.com/lists/php-dev/200309/msg00189.html

If you are running apache with mod_perl and at least one other module, you may want to compile your perl with -DPERL_USE_SAFE_PUTENV. If your perl is not compiled with this macro defined, libperl.a will contain code that plays dangerously with the global variable environ, which can lead to segmentation faults when other apache modules call putenv() ...... If you see -DPERL_USE_SAFE_PUTENV in the output, your perl was compiled with that option and your apache shouldn't exhibit the bad behavior in question. If you don't see it, and apache is crashing with stack traces that contain the function putenv(), reconfigure with

$ ./Configure --Acppflags=-DPERL_USE_SAFE_PUTENV

along with any other Configure options you may need. Run "make", "make test", and "make install." Then recompile mod_perl. If your mod_perl is statically linked into apache, recompile apache as well.

Is this really necessary? Anyone come across this problem?


In reply to Static mod_perl with DSO mod_php segfaulting by gunzip

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.