# Hmmm  Problems with apache - php5

## dimorge

List of all my packages

```

sbrotherhood lib # equery list

[ Searching for all packages in all categories among: ]

 * installed packages

[I--] [  ] app-admin/metalog-0.8_pre20031130 (0)

[I--] [  ] app-arch/ncompress-4.2.4-r1 (0)

[I--] [  ] app-arch/tar-1.14 (0)

[I--] [M ] app-arch/bzip2-1.0.2-r3 (0)

[I--] [M ] app-arch/cpio-2.5 (0)

[I--] [M ] app-arch/gzip-1.3.5-r2 (0)

[I--] [  ] app-crypt/mhash-0.9.2 (0)

[I--] [  ] app-editors/nano-1.3.4 (0)

[I--] [  ] app-misc/mime-types-1.0-r1 (0)

[I--] [M ] app-portage/mirrorselect-0.86 (0)

[I--] [  ] app-portage/gentoolkit-0.2.0 (0)

[I--] [  ] app-shells/bash-2.05b-r9 (0)

[I--] [  ] app-shells/sash-3.7 (0)

[I--] [  ] app-text/sablotron-1.0.1 (0)

[I--] [  ] app-text/aspell-0.60.2 (0)

[I--] [  ] dev-db/mysql-4.0.24-r1 (0)

[I--] [M ] dev-lang/perl-5.8.4-r1 (0)

[I--] [M ] dev-lang/python-2.3.4 (2.3)

[I--] [  ] dev-libs/openssl-0.9.7d-r1 (0)

[I--] [  ] dev-libs/expat-1.95.7 (0)

[I--] [  ] dev-libs/popt-1.7-r1 (0)

[I--] [  ] dev-libs/apr-0.9.6-r1 (0)

[I--] [  ] dev-libs/libpcre-4.5 (3)

[I--] [  ] dev-libs/libgpg-error-1.0-r1 (0)

[I--] [  ] dev-libs/ucl-1.03 (0)

[I--] [  ] dev-libs/apr-util-0.9.6 (0)

[I--] [  ] dev-libs/libmcrypt-2.5.7 (0)

[I--] [  ] dev-libs/libxml2-2.6.18 (2)

[I--] [  ] dev-libs/libgcrypt-1.2.1 (0)

[I--] [  ] dev-libs/libxslt-1.1.13 (0)

[I--] [  ] dev-perl/DBD-mysql-2.9003 (0)

[I--] [  ] dev-perl/Net-Daemon-0.38 (0)

[I--] [  ] dev-perl/Storable-2.13 (0)

[I--] [  ] dev-perl/PlRPC-0.2016-r1 (0)

[I--] [  ] dev-perl/DBI-1.46 (0)

[I--] [  ] dev-php/mod_php-4.3.10-r1 (2)

[I--] [  ] dev-php/php-5.0.3-r1 (0)

[I--] [  ] dev-python/python-fchksum-1.7.1 (0)

[I--] [  ] dev-util/dialog-1.0.20040731 (0)

[I--] [  ] dev-util/yacc-1.9.1-r2 (0)

[I--] [  ] mail-mta/ssmtp-2.60.9 (0)

[I--] [  ] media-libs/freetype-2.1.9-r1 (2)

[I--] [  ] media-libs/t1lib-5.0.2 (5)

[I--] [  ] media-libs/libpng-1.2.8 (1.2)

[I--] [  ] media-libs/freetype-1.3.1-r4 (1)

[I--] [  ] media-libs/jpeg-6b-r4 (0)

[I--] [  ] media-libs/clibpdf-202_p1 (0)

[I--] [  ] media-libs/netpbm-10.20 (0)

[I--] [  ] media-libs/gd-2.0.32 (2)

[I--] [  ] media-libs/svgalib-1.9.19-r3 (0)

[I--] [  ] net-analyzer/netselect-0.3-r1 (0)

[I--] [  ] net-libs/libwww-5.4.0-r2 (0)

[I--] [  ] net-mail/mailbase-0.00-r6 (0)

[I--] [  ] net-misc/openssh-3.8.1_p1-r1 (0)

[I--] [  ] net-misc/iputils-021109-r3 (0)

[I--] [  ] net-misc/wget-1.9-r2 (0)

[I--] [  ] net-misc/dhcpcd-1.3.22_p4-r5 (0)

[I--] [M ] net-misc/rsync-2.6.3 (0)

[I--] [  ] net-www/apache-2.0.53 (2)

[I--] [  ] net-www/gentoo-webroot-default-0.1 (0)

[I--] [  ] sys-apps/baselayout-1.9.4-r6 (0)

[I--] [  ] sys-apps/debianutils-1.16.7-r4 (0)

[I--] [  ] sys-apps/miscfiles-1.3-r1 (0)

[I--] [  ] sys-apps/shadow-4.0.4.1-r4 (0)

[I--] [M ] sys-apps/gawk-3.1.3-r1 (0)

[I--] [  ] sys-apps/sed-4.0.9 (0)

[I--] [  ] sys-apps/pam-login-3.14 (0)

[I--] [M ] sys-apps/util-linux-2.12-r4 (0)

[I--] [M ] sys-apps/coreutils-5.2.1 (0)

[I--] [  ] sys-apps/module-init-tools-3.0-r2 (0)

[I--] [  ] sys-apps/findutils-4.1.20-r1 (0)

[I--] [  ] sys-apps/grep-2.5.1-r6 (0)

[I--] [  ] sys-apps/diffutils-2.8.4-r4 (0)

[I--] [M ] sys-apps/ed-0.2-r4 (0)

[I--] [M ] sys-apps/file-4.10 (0)

[I--] [  ] sys-apps/groff-1.18.1-r4 (0)

[I--] [  ] sys-apps/texinfo-4.8 (0)

[I--] [M ] sys-apps/man-pages-1.67 (0)

[I--] [M ] sys-apps/man-1.5m-r2 (0)

[I--] [  ] sys-apps/kbd-1.12-r2 (0)

[I--] [  ] sys-apps/less-382-r2 (0)

[I--] [  ] sys-apps/net-tools-1.60-r9 (0)

[I--] [M ] sys-apps/setserial-2.17-r2 (0)

[I--] [  ] sys-apps/which-2.16 (0)

[I--] [  ] sys-apps/tcp-wrappers-7.6-r8 (0)

[I--] [  ] sys-apps/hdparm-5.7-r1 (0)

[I--] [  ] sys-apps/hotplug-base-20040401 (0)

[I--] [  ] sys-apps/hotplug-20040923 (0)

[I--] [  ] sys-apps/pciutils-2.1.11-r3 (0)

[I--] [  ] sys-apps/usbutils-0.11-r5 (0)

[I--] [  ] sys-apps/portage-2.0.51.19 (0)

[I--] [  ] sys-apps/slocate-2.7-r7 (0)

[I--] [  ] sys-boot/grub-0.95.20040823 (0)

[I--] [  ] sys-devel/binutils-2.14.90.0.8-r1 (0)

[I--] [M ] sys-devel/gcc-3.3.4-r1 (3.3)

[I--] [M ] sys-devel/gcc-config-1.3.6-r3 (0)

[I--] [  ] sys-devel/gettext-0.12.1-r2 (0)

[I--] [  ] sys-devel/libperl-5.8.4-r1 (1)

[I--] [  ] sys-devel/m4-1.4.1 (0)

[I--] [  ] sys-devel/patch-2.5.9 (0)

[I--] [M ] sys-devel/autoconf-2.59-r5 (2.5)

[I--] [M ] sys-devel/automake-1.8.5-r1 (1.5)

[I--] [  ] sys-devel/gnuconfig-20040214 (0)

[I--] [  ] sys-devel/bc-1.06-r5 (0)

[I--] [  ] sys-devel/flex-2.5.4a-r5 (0)

[I--] [M ] sys-devel/libtool-1.5.2-r5 (1.5)

[I--] [  ] sys-devel/bison-1.875 (0)

[I--] [  ] sys-devel/make-3.80-r1 (0)

[I--] [  ] sys-devel/bin86-0.16.0 (0)

[I--] [  ] sys-fs/devfsd-1.3.25-r8 (0)

[I--] [M ] sys-fs/e2fsprogs-1.35 (0)

[I--] [  ] sys-kernel/linux-headers-2.4.21-r1 (0)

[I--] [M ] sys-kernel/gentoo-dev-sources-2.6.9-r1 (2.6.9-gentoo-r1)

[I--] [M ] sys-kernel/genkernel-3.1.0a (0)

[I--] [  ] sys-libs/glibc-2.3.4.20040808-r1 (2.2)

[I--] [  ] sys-libs/ncurses-5.4-r5 (5)

[I--] [  ] sys-libs/zlib-1.2.1-r3 (0)

[I--] [  ] sys-libs/db-4.1.25_p1-r3 (4.1)

[I--] [  ] sys-libs/readline-4.3-r5 (0)

[I--] [M ] sys-libs/cracklib-2.7-r9 (0)

[I--] [  ] sys-libs/pam-0.77 (0)

[I--] [  ] sys-libs/pwdb-0.62 (0)

[I--] [  ] sys-libs/gdbm-1.8.3-r1 (0)

[I--] [  ] sys-libs/gpm-1.20.1-r4 (0)

[I--] [  ] sys-libs/db-1.85-r2 (1)

[I--] [  ] sys-process/psmisc-21.4 (0)

[I--] [  ] sys-process/procps-3.2.3-r1 (0)

[I--] [  ] sys-process/cronbase-0.3.1 (0)

[I--] [M ] sys-process/vixie-cron-4.1-r2 (0)

[I--] [M ] www-proxy/ntlmaps-0.9.8 (0)

```

Apache2.conf

```

# read the files in the /etc/apache2/modules.d directory.

APACHE2_OPTS="-D SSL -D PHP5"

# Extended options for advanced uses of Apache ONLY

# You don't need to edit these unless you are doing crazy Apache stuff

# As not having them set correctly, or feeding in an incorrect configuration

# via them will result in Apache failing to start

# YOU HAVE BEEN WARNED.

```

httpd.conf

```

#LoadModule usertrack_module              modules/mod_usertrack.so

#LoadModule asis_module                   modules/mod_asis.so

LoadModule php5_module          /usr/lib/libphp5.so

#

# Extra Modules

#

# We Include extra .conf files from /etc/apache2/modules.d

# This is used to load things like PHP and mod_ssl.

#

Include conf/modules.d/*.conf

```

This is the error i get when i try to start apache2:

```

sbrotherhood lib # apache2 -k restart

Syntax error on line 350 of /etc/apache2/httpd.conf:

Can't locate API module structure `php5_module' in file /usr/lib/libphp5.so: /usr/lib/libphp5.so: undefined symbol: php5_module

```

When i updated apache2.conf i did do a env-update. 

Could you please look at my configuration and let me know what you think may be wrong?

----------

## masseya

I really don't know a whole lot about php and apache, but you have both mod_php-4.3.10-r1 and php-5.0.3-r1 installed.  Are those compatible?  Also, php has some issues with apache2, though, I don't think this is what's happening to you.

http://www.php.net/manual/en/faq.installation.php#faq.installation.apache2

----------

## dimorge

I noticed that there is no mod_php-5 version installed on my server. I synced my portage tree and i still do not see a mod_php version for php5. Is there a ebuild of a where i dont have to compile php, mod_php from source? I sit there for 3 hours waiting for it to compile just to find out it's not working.

----------

## masseya

http://packages.gentoo.org/search/?sstring=mod_php

It's on my system in the directory /usr/portage/dev-php/mod_php.

----------

## JudgeNik

I have php-5.0.3 and apache-2.0.53 (with the new httpd.conf)

I'm having the same problem and it is in portage but it is "masked"?

```
# emerge -av =mod_php-5.0.3-r2

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

Calculating dependencies

!!! All ebuilds that could satisfy "=mod_php-5.0.3-r2" have been masked.

!!! One of the following masked packages is required to complete your request:

- dev-php/mod_php-5.0.3-r2 (masked by: package.mask)

# Stuart Herbert <stuart@gentoo.org> (12th march 2005)

# automatically activates ZTS mode when any threaded MPMs are installed,

# even if mpm_prefork is the default

For more information, see MASKED PACKAGES section in the emerge man page or

section 2.2 "Software Availability" in the Gentoo Handbook.

```

----------

## masseya

It appears to be masked for some of the same reasons listed in the link I provided in my first post to this thread.

----------

## rth

Does that mean there is no mod_php5 available? There are a number of packages that need unmasking in order to allow us to emerge mod_php5.

Edit:

Info found here: http://dev.gentoo.org/~vericgar/doc/apache-package-refresh.html

----------

## Stuart_Gilbert

I'm having this same kind of error. I've tried compiling apache and php multiple times. I've tried deleting libphp5.so  to make sure that it's using a newly compiled one instead of some older version...

Nothing I do seems to allow PHP to be loaded into Apache 2.

```
LoadModule php5_module          lib/libphp5.so
```

That's what I added to apache2.conf I didn't add the -D php thing in the other conf file, I thought that was only for use with mod_php, and I don't have that installed.

This is the error I get when trying to start Apache:

```
 * Apache2 has detected a syntax error in your configuration files:

Syntax error on line 58 of /etc/apache2/conf/apache2.conf:

Can't locate API module structure `php5_module' in file /usr/lib/apache2/modules/libphp5.so: /usr/lib/apache2/modules/libphp5.so: undefined symbol: php5_module
```

Line 58 of apache2.conf is the LoadModule line that I pasted above.

My USE variable includes "apache2" so I don't see why it doesn't work.

Any help with this would be greatly appreciated, as I don't really want to bother with mod_php if I can possibly avoid it.

----------

## robrpn

Im having the same problem, although im still using apache1. My machine previously had ">=dev-php/mod_php-5.0.3" on it (which worked fine). Have done an "emerge -vupD --newuse world" since, and its stopped working. 

Note that i think to install php5.0.3, mod_php4 is installed as a dependancy.

Any help grately appreciated. Cheers.

----------

## robrpn

I think ive solved it. My package mask was set to block mod_php5, hence it was installing mod_php4 and php5 (i think). 

Seems to have been fixed by commenting out mod_php5 mask in /usr/portage/profiles/package.mask on line ~297, ie. #=dev-php/mod_php-5*

Note some things had to be set some things in /etc/portage/package.keywords to allow installation with ~x86.

----------

