# Apache 1.3.26 and PHP 4.2.2 - segfaults

## phubuh

I recently merged Apache and mod_php. It started up at first, but when I tried to access a PHP page it just printed the source.

Well, I changed /etc/conf.d/apache so Apache uses PHP, and now I'm getting segfaults when I start it.

```

root@superfly /etc/conf.d$ /etc/init.d/apache start

 * Starting apache...

/sbin/runscript.sh: line -30:  4032 Segmentation fault      start-stop-daemon --quiet --start --startas /usr/sbin/apache --pidfile /var/run/apache.pid -- ${APACHE_OPTS}                                        [ !! ]

```

----------

## phubuh

Sigh. I unmerged Apache and mod_php, ran emerge rsync, emerge clean, and merged Apache and mod_php again.

Same deal.

Please, someone else has to have had this problem! I'm going crazy.  :Sad: 

----------

## GreyCrow

Perhaps you could post the code how you implemented mod_php in the apache conf?

----------

## rac

I don't know if you want to go to all this trouble, and I think I hear delta407's footsteps coming up to "Bah" me again, but...

It looks like the apache binary is stripped in the ebuild, but if you could get an unstripped apache binary, run it with the -X option so it doesn't fork, use ulimit to raise your core file size, then run your test, you might be able to get a usable core dump out of apache that could tell you where the crashing is occurring.

I had an obscure conflict like this once with software I wrote that ran under mod_perl and used expat to parse XML documents - the expat-lite library that was compiled into Apache had different function signatures for expat functions, and that smashed the stack.

----------

## ptheborg

I'm having exactly the same problem as phubuh!  :Sad:  (So you're not alone phubuh)

A week or two ago, before I reinstalled Gentoo, it was working very well. apache mod_php-4.2.2 mod_ssl.

But now, the same setup gives me these nasty segmentation faults  :Sad: 

Note: I've installed mysql with berkdb and postgresql. So mod_php get's compiled with those flags on.....but like I said, it used to work.

[edit] I've tried mod_php-4.2.1-r5 but gave me the same seg fault  :Sad:  [/edit]

[edit2] Forgot to mention that starting apache with only mod_ssl works great. It's just that darn php module. [/edit2]

[edit3] gcc 2.95.3 (gentoo 1.2), gentoo-sources 2.4.19-r7 [/edit3]

PLEASE HELP US!!!!!!

=============================================

seg fault:

/sbin/runscript.sh: line -30:  6106 Segmentation fault      start-stop-daemon --quiet --start --startas /usr/sbin/apache --pidfile /var/run/apache.pid -- ${APACHE_OPTS}

USE="mmx -3dnow sse sse2 -3dfx -voodoo3 -matrox acpi pcmcia pnp -pda X dga opengl xv fbcon directfb kde qt qtmt arts -gnome -nls motif imlib ncurses readline sdl svga gif jpeg png avi mpeg quicktime alsa dvd xmms oggvorbis encode pam ssl crypt tcpd mozilla spell truetype xml2 pdflib python slang java libwww libg++ berkdb gdbm samba gpm mysql postgres zlib"

CHOST="i686-pc-linux-gnu"

CFLAGS="-march=i686 -O3 -pipe"

CXXFLAGS="-march=i686 -O3 -pipe"

----------

## Lyquid

I tried to setup Apache today.  I get the same exact error messsage that is listed above.  As of note, Apache worked fine without mod_php...

Any ideas?

----------

## Lyquid

Ok.  I did figure out a way to prevent the segmentation fault error.  But...  For Apache, I am not using php, instead I am using mod_php.  I assume I need to change /etc/conf.d/apache to reflect the use of mod_php.

So, I changed the following :

```

APACHE_OPTS="-D SSL -D PHP4"

```

to

```

APACHE_OPTS="-D SSL -D MOD_PHP"

```

I just took a guess at what to substitute for the PHP4, so I am not sure if this is proper syntax.  But, when I now try and start Apache, I no longer receive an error message (i.e. segmentation fault).  But, SSL and PHP do not work.  I determined this by following the test examples in the Desktop Configuration Guide provide on the Gentoo web site.

Also, when I originally installed Apache, I installed php and mod_ssl.  Apache would start just fine, and SSL worked.  But, I noticed that php wasn't working.  So, after searching the forums, I determined that mod_php was required for Apache, and php was not necessary.  So, I unmerged php and performed an emerge on mod_php.  Since I did this, SSL and PHP do not work.  Weird...

Any ideas?  Thanks.

----------

## ptheborg

Lyquid: APACHE_OPTS="-D SSL -D MOD_PHP" the mod_php value is not correct. It should be PHP4. If you check the apache.conf, you'll find out that when that value is passed as an argument to apache, only then the module will be loaded......

but that is the whole point here, if you'll only pass -D SSL, everything works fine, exept no PHP. When you pass -D PHP4 -D SSL things go segfault....    :Crying or Very sad: 

Phubuh, Lyquid and I can't be the only three having this problem....anyone with suggestions or solutions?

----------

## kch

I have the same problems like you. I'm using 

kernel: 2.4.19

gcc version 2.95.3 20010315 (release)

Server version: Apache/1.3.26 (Unix)

mod_php: 4.2.2

I'm reading an open bug in bugs.gentoo.org than sound like mine, but is not the same. They propose a solution that don't work for me (compile using LDFLAGS='-lgcc' )

You can get more information in

https://bugs.gentoo.org/show_bug.cgi?id=3876

----------

## El_Presidente_Pufferfish

*shrugs*

i cant even get PHP to compile

good luck guys

----------

## orochi

im having the same problem, php seg faults, so this isnt an isolated thiing, anyone figure out whats wrong yet?

----------

## Lyquid

If this helps diagnose the problem...  I have the following:

kernel: vanilla-sources-2.4.19  

gcc:  2.95.3 

web server: Apache 1.3.26r3

mod_php: 4.2.2

mod_ssl:  2.8.10

If anyone can help, thanks in advance!!   :Smile: 

----------

## goldorak_dan

 *phubuh wrote:*   

> I recently merged Apache and mod_php. It started up at first, but when I tried to access a PHP page it just printed the source.
> 
> 

 

For your "source" problem. Looks like this:

https://forums.gentoo.org/viewtopic.php?t=11199&highlight=apache+php+ssl#62399

might help

----------

## Miguel

I have exactly the same problem with segfaults...

Apache 1.3.26

mod_php 4.2.2

And I haven't a clue about what's going on...

----------

## AdamG

same here..   :Confused: 

----------

## AdamG

I hope this is fixed soon..big problem..

 :Shocked: 

----------

## rac

What's the bug tracking number everybody can use to follow the progress of this issue on https://bugs.gentoo.org?

----------

## AdamG

im not sure it was reported..

 :Laughing: 

----------

## rac

 *AdamG wrote:*   

> im not sure it was reported..
> 
> 

 

I'll assume by your  :Laughing:  that you understood that that was my point.  If you hope it's fixed soon, because it's a big problem, it stands a better chance of getting fixed faster if you fill out a bug report and follow up on it.

----------

## hazkal

i just installed apache/php on my box and what after 

```
emerge mod_php
```

 finishes..it tells you this:

```

Execute ebuild /var/db/pkg/dev-php/mod_php-4.2.2/mod_php-4.2.2ebuild config

to have your apache.conf auto-updated for use with this module.

```

all I did to get an html page that only has 

```
<?php phpinfo() ?>
```

 to work was that, and then uncommenting the APACHE_OPTS in the /etc/conf.d/apache file

not sure if that helps or not, but it does work for me now.

----------

## SubZero

I'm having the same problem!

Executing php at terminal gives me Segmentation Fault

Apache won't run with mod_php too.

Anybody here fixed the problem? I couldn't found the bug at https://bugs.gentoo.org.

Thanks!

----------

## DeKoder

Hi ppl! I'm posting here because i'd like to install mod_php 4.2.2 in Apache 2.0.40 , but so far, mod_php still asks for Apache 1.3.26 ....Does somebody know when will mod_php support Apache 2.0.40? I think this version is quite better than the 1.x series, so i'd really like to run it on my servers, instead of 1.3.26...

Cheers

DeKoder

----------

## AdamG

 *DeKoder wrote:*   

> Hi ppl! I'm posting here because i'd like to install mod_php 4.2.2 in Apache 2.0.40 , but so far, mod_php still asks for Apache 1.3.26 ....Does somebody know when will mod_php support Apache 2.0.40? I think this version is quite better than the 1.x series, so i'd really like to run it on my servers, instead of 1.3.26...
> 
> Cheers
> 
> DeKoder

 

no one is really sure..just going ot have to wait..

i dont realy think thisi s the cofrrect thread for that anyhow =x

there has been many more posts liek your..try searching  :Wink: 

----------

## kch

There is already an open bug at bugs.gentoo.org (id 3876)

----------

## kch

https://bugs.gentoo.org/show_bug.cgi?id=3876

Now it's working for me. You only need to include 

    export LDFLAGS=-lstdc++

in the /usr/portage/app-text/sablotron/sablotron-0.95-r1.ebuild just before the line with 

    econf ${myconf} || die

in the 

It will look like:

src_compile() {

    local myconf

    use perl && myconf="--enable-perlconnect"

    export LDFLAGS=-lstdc++

    econf ${myconf} || die

    make || die

}

You should compile sablotron and everything works fine altough you don't need it.Last edited by kch on Sat Sep 07, 2002 6:12 pm; edited 1 time in total

----------

## mgirard

I recently ran into this problem and decided to do extensive testing on the ebuild to find out what was going on. I needed mod_php built, no matter what it was going to take...

The result was that I found out that the line "--with-gmp" was causing 100% of the problems for me. I removed this one line from the ebuild and compiled mod_php with imap, imap-ssl, pdflib, xml, xml2, gettext, java, ldap... hell, basically everything that it can link against (no oci8 though). It works PERFECTLY without the forced GMP stuff. Probably a bug with GMP, or at least the way it is trying to link against it. I do not need the gmp crap, so this is a good solution for me.   :Smile: 

Anyway, I hope this helps someone fix the ebuild. Actually, I included 2 other lines on my ebuild to link againt pspell when the "spell" keyword is active. I will provide a diff if anyone is interested...

Cheers,

Mg

----------

## AdamG

can you tell us how to edit the ebuild ot get this working?   :Confused: 

----------

## AdamG

worked..thanks   :Cool: 

----------

## SubZero

I'll try this tonight. Thanks!

----------

## tgnb

The last entry on the bug was on 8/15

I just installed a fresh system and ran across this bug also. I tried all the possible solutions mentioned in the bug report but none of them resolved the issue for me. From what i am reading there isnt yet a fix? Does anyone know of at least a workaround? How could i get apache with php support to run on Gentoo atm?

----------

## ptheborg

mgirard, thanks!

Removing the --with-gmp line worked for me, I didn't need it so it doesn't matter.

----------

## SubZero

Thanks mgirard!

After weeks without php, removing with-gmp worked!

Even at php4.2.2-r1 I needed to remove with-gmp.

Regards,

Paulo Assis

----------

