# Apache won't start with php

## vodka

I am trying to get apache (1.3.something-r4) to work with PHP. After emerge apache php mod_php when starting the server I get the following:

```
knarf root # /etc/init.d/apache start

 * Starting apache...

Syntax error on line 57 of /etc/apache/conf/apache.conf:

Cannot load /etc/apache/extramodules/libphp4.so into server: /etc/apache/extramodules/libphp4.so: undefined symbol: unixd_config                       [ !! ]
```

I already reemerged it, but no change... My USE flags look like this:

```
USE="artswrappersuid cjk curl directfb flash gd imap lcms matrox mbox \

     moznocompose moznoirc moznomail odbc pic samba tiff usb vim-with-x \

     wmf xface xfs xinerama xml xosd"
```

Any hints on how to get this to work? I really have no clue what goes wrong here...

----------

## dberkholz

Have you examined line 57 of apache.conf? Remember to run the necessary commands to configure apache to run with PHP. See the desktop configuration guide on www.gentoo.org.

----------

## vodka

That I did, and it contains the following:

```
<IfDefine PHP4>

LoadModule php4_module    extramodules/libphp4.so

</IfDefine>
```

It tries to load the module but it cannot find mentioned symbol.

Thanks for mentioning this guide tough... as soon as apache and php work, I will install squirelmail...

But for now, it cannot find a symbol it needs... why is that and what can I do about it?

```

[knarf@pts/2 ~]% ldd /etc/apache/extramodules/libphp4.so

        libcrypt.so.1 => /lib/libcrypt.so.1 (0x403c7000)

        libssl.so.0.9.6 => /usr/lib/libssl.so.0.9.6 (0x403f4000)

        libcrypto.so.0.9.6 => /usr/lib/libcrypto.so.0.9.6 (0x40423000)

        libsablot.so.0 => /usr/lib/libsablot.so.0 (0x404e6000)

        libexpat.so.0 => /usr/lib/libexpat.so.0 (0x405a6000)

        libqt-mt.so.3 => /usr/qt/3/lib/libqt-mt.so.3 (0x405cc000)

        libpspell.so.15 => /usr/lib/libpspell.so.15 (0x40c30000)

        libpdf.so.1 => /usr/lib/libpdf.so.1 (0x40c32000)

        libz.so.1 => /usr/lib/libz.so.1 (0x40cd6000)

        libtiff.so.3 => /usr/lib/libtiff.so.3 (0x40ce4000)

        libpng.so.3 => /usr/lib/libpng.so.3 (0x40d2b000)

        libmysqlclient.so.12 => /usr/lib/libmysqlclient.so.12 (0x40d57000)

        libming.so => /usr/lib/libming.so (0x40d98000)

        libm.so.6 => /lib/libm.so.6 (0x40dd4000)

        libmhash.so.2 => /usr/lib/libmhash.so.2 (0x40df6000)

        libmcrypt.so.4 => /usr/lib/libmcrypt.so.4 (0x40e14000)

        libltdl.so.3 => /usr/lib/libltdl.so.3 (0x40e4a000)

        libpam.so.0 => /lib/libpam.so.0 (0x40e51000)

        libt1.so.1 => /usr/lib/libt1.so.1 (0x40e5a000)

        libttf.so.2 => /usr/lib/libttf.so.2 (0x40ea7000)

        libX11.so.6 => /usr/X11R6/lib/libX11.so.6 (0x40ed1000)

        libXpm.so.4 => /usr/X11R6/lib/libXpm.so.4 (0x40fb0000)

        libjpeg.so.62 => /usr/lib/libjpeg.so.62 (0x40fbf000)

        libxsltbreakpoint.so.1 => /usr/lib/libxsltbreakpoint.so.1 (0x40fdf000)

        libxslt.so.1 => /usr/lib/libxslt.so.1 (0x40fe2000)

        libdb.so.2 => /usr/lib/libdb.so.2 (0x41010000)

        libgdbm.so.2 => /usr/lib/libgdbm.so.2 (0x4101f000)

        libcrack.so.2 => /usr/lib/libcrack.so.2 (0x41025000)

        libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x4102f000)

        libresolv.so.2 => /lib/libresolv.so.2 (0x4103e000)

        libdl.so.2 => /lib/libdl.so.2 (0x41050000)

        libnsl.so.1 => /lib/libnsl.so.1 (0x41053000)

        libcurl.so.2 => /usr/lib/libcurl.so.2 (0x41067000)

        libxml2.so.2 => /usr/lib/libxml2.so.2 (0x4108d000)

        libodbc.so.1 => /usr/lib/libodbc.so.1 (0x4118e000)

        libc.so.6 => /lib/libc.so.6 (0x411f0000)

        libstdc++.so.5 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/libstdc++.so.5 (0x41319000)

        libpthread.so.0 => /lib/libpthread.so.0 (0x413dc000)

        libaudio.so.2 => /usr/X11R6/lib/libaudio.so.2 (0x4142c000)

        libXt.so.6 => /usr/X11R6/lib/libXt.so.6 (0x41441000)

        libmng.so.1 => /usr/lib/libmng.so.1 (0x41498000)

        libGL.so.1 => /usr/lib/libGL.so.1 (0x414dc000)

        libXmu.so.6 => /usr/X11R6/lib/libXmu.so.6 (0x41544000)

        libXi.so.6 => /usr/X11R6/lib/libXi.so.6 (0x4155a000)

        libXrender.so.1 => /usr/X11R6/lib/libXrender.so.1 (0x41562000)

        libXft.so.2 => /usr/X11R6/lib/libXft.so.2 (0x4156a000)

        libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x4157d000)

        libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x415d9000)

        libXext.so.6 => /usr/X11R6/lib/libXext.so.6 (0x41604000)

        libSM.so.6 => /usr/X11R6/lib/libSM.so.6 (0x41614000)

        libICE.so.6 => /usr/X11R6/lib/libICE.so.6 (0x4161d000)

        libgcc_s.so.1 => /usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.3/libgcc_s.so.1 (0x41634000)

        libaspell.so.15 => /usr/lib/libaspell.so.15 (0x4163d000)

        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x80000000)

        libXau.so.6 => /usr/X11R6/lib/libXau.so.6 (0x416dd000)

        libGLcore.so.1 => /usr/lib/libGLcore.so.1 (0x416e0000)

```

It looks like it can find all the libs it needs (GLcore??? well, whatever)...

but then why...

----------

## vodka

OK, this was solved by unmerging apache2 and remerging mod_php.. No clue what apache2 was doing there in the first place, but now it's gone everything works smoothly... 

Tnx spyderous for your time and that guide  :Smile: 

----------

## dberkholz

You had apache2 on there? The problem may have been having apache2 without a USE flag for apache2.

----------

## vodka

I had... and I did not want it... I don't know how it came there. Could it be that "emerge apache" also merges apache2?

```

[knarf@pts/0 ~]% emerge -p apache

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild    U ] net-www/apache-2.0.46 [1.3.27-r4]

```

Yes... so now if I ever run emerge -u again, my apache will stop working because apache2 gets installed. Then I manualy emerge -C it and remerge mod_php...

Does no one else have this problem?

----------

## dberkholz

You must be running ~arch. There's really very few reasons not to run apache2, since almost all the modules support it. My solution to this is to place a package.mask file in PORTDIR_OVERLAY/profiles/:

```
>=apache-2
```

----------

## vodka

Does AxKit also support apache2?

The main reason for installing apache here is I want to experiment with AxKit.

----------

## dberkholz

 *vodka wrote:*   

> Does AxKit also support apache2?

 

I can't imagine why not as long as you have mod_perl.

----------

## dberkholz

 *spyderous wrote:*   

>  *vodka wrote:*   Does AxKit also support apache2? 
> 
> I can't imagine why not as long as you have mod_perl.

 

In fact, I was just told it wasn't ported to apache2. But take a look for yourself.

----------

## tommitek

I followed the "Desktop Configuration Guide" -- step 8 (Apache and Squirrelmail Webmail) and have the exact same problem when trying to start apache: 

```
Syntax error on line 57 of /etc/apache/conf/apache.conf:

Cannot load /etc/apache/extramodules/libphp4.so into server: /etc/apache/extramodules/libphp4.so: undefined symbol: unixd_config
```

Aside from unmerging Apache2, how can the "unixd_config" symbol be satisfied to make this work?[/code]

----------

## foxcub

I'm having the same problem. I had apache with php installed, then I added apache2. I do not have apache2 in my USE flags, and I don't need PHP for it (the only reason I need apache2 is for subversion). After an emerge -u world yesterday, php upgraded itself, but now I'm getting the same error as the original poster (about an undefined symbol in a module). What is the problem and how can I solve it? It's almost as if php found apache2, and compiled itself for apache2, and, as a result, did not want to work with apache.

----------

## vodka

```
[knarf@pts/5 :l/portage]% su -c "echo \">=apache-2\" > profiles/package.mask"

Password:

[knarf@pts/5 :l/portage]% cat profiles/package.mask

>=apache-2

[knarf@pts/5 :l/portage]% sudo emerge -up apache

These are the packages that I would merge, in order:

Calculating dependencies ...done!

[ebuild    U ] net-www/apache-2.0.46 [1.3.27-r4]

```

Well... Any suggestions? And yes, that is my $PORTDIR_OVERLAY...

----------

## dberkholz

Hmm....try   >=net-www/apache-2   and see if that helps. That's the format of package.mask.

----------

## vodka

That I did immediately after posting (should have tried before posting but in this case that didn't matter since...), but it still tries to upgrade...

```
[knarf@pts/0 ~]% cat /etc/make.conf | grep ^PORTDIR_OVERLAY

PORTDIR_OVERLAY=/usr/local/portage

[knarf@pts/0 ~]% ls /usr/local/portage/profiles/package.mask

/usr/local/portage/profiles/package.mask

[knarf@pts/0 ~]% cat /usr/local/portage/profiles/package.mask

>=net-www/apache-2

```

 :Confused: 

----------

## dberkholz

I'm not really sure why it's not working, but here's an option that's more work.  Move all the apache-2* ebuilds to PORTDIR_OVERLAY, and in them, change KEYWORDS="~x86 ..." to KEYWORDS="-x86 ..."

----------

## vodka

And then the next time, when a new apache ebuild is released, I have to do that over again since there will, again, be a newer version  :Sad: .

For now I added >=net-www/apache-2 to /usr/portage/profiles/package.mask, and there it *does* work... so next time I sync, I'll do that again... and again... and...

----------

