Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-12-2005, 04:28 AM   #1
john lee
Registered: Jun 2001
Location: Sydney, Australia
Posts: 42

Rep: Reputation: 15
Unhappy mod_perl causes segementation fault in Apache when php runs

Hi all,

I just wonder if anyone could help me in this as I have spent days trying to fix this problem.

I installed php 5.0.4, perl 5.8.7, mod_perl 1.0 and apache 1.3.33 into the same box.

Before mod_perl was installed, php programs ran fine. However, once mod_perl is installed, running php program created segment fault error and the apache log shows:

[notice] child pid 2838 exit signal Segmentation fault (11)

If I remove mod_perl from apache, the php program runs fine.

I read from

that I need to re-configure perl with:
$ ./Configure --Acppflags=-DPERL_USE_SAFE_PUTENV
and then do:
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.

When I ran perl -V:cppflags, it came back with:
cppflags='-DPERL_USE_SAFE_PUTENV -fno-strict-aliasing -pipe -I/usr/local/include -I/usr/include/gdbm';

I thought it is okay but but still hit the same problem.

Can anyone please help me?
Old 10-13-2005, 01:44 AM   #2
john lee
Registered: Jun 2001
Location: Sydney, Australia
Posts: 42

Original Poster
Rep: Reputation: 15
Talking Fix Now!

I think I was distracted by the putenv() issue.

As it turns out, it was just a matter of dynamically linking mod_perl instead of static link. Linking mod_perl statically into Apache will cause a memory shortage to php.

So, to install Apache, mod_perl and php.

Step 1. Apache
Just install it normally.
./configure --enable-module=so \
--enable-module=rewrite \
make install

Don't include "--activate-module=src/modules/perl/libperl.a" in the configure script.

Step 2. mod_perl
perl Makefile.PL \
WITH_APXS=/usr/local/apache/bin/apxs \ EVERYTHING=1
make install

Step 3. php
./configure --with-mysql=/usr/local/mysql \
--with-apxs=/usr/local/apache/bin/apxs \
make install

The community has been successfully installing php, mod_perl and apache for ages but just that there are always people who want to learn more....


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Segementation Fault Error (Core Dumped) ??? Programming 8 10-17-2005 12:10 PM
Segementation fault on Multi threaded server on ia-64 Linux Latha Linux - Software 3 09-09-2004 07:40 PM
SDL Segementation Fault when calling function SDL_LockSurface fatherg Programming 2 03-29-2004 04:07 PM
Apache 2.0.45 and mod_perl arkopolo Linux - Software 0 07-03-2003 03:06 PM
Apache / Mod_Perl / PHP Please help mdkelly Linux - Software 4 02-09-2003 04:24 AM

All times are GMT -5. The time now is 07:21 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration