# problems with mod_php-4.2.3 and apache

## morck

finally i got mod_php installed after i changed one line in the ebuild

(--with-apxs to --with-apxs2)  but now i can't get apache to use this mod.

at the end of emerging mod_php it says, that i have to run:

ebuild /var/db/pkg/dev-php/mod_php-4.2.3/mod_php-4.2.3.ebuild config

when i do this i only get this error:

/usr/sbin/ebuild.sh: line 233: //usr/sbin/apacheaddmod: No such file or directory

so does anyone know what i have to do instead to get it working???

----------

## morck

ok, since anybody seems to now what to do, maybe this will help you to answer my question:

in the apache2 - Changelog it says:

 *Quote:*   

> simply install the desired
> 
>   module and edit /etc/conf.d/apache2.  There's no longer the need
> 
>   for the 'ebuild /var/db/pkg/.../foo.ebuild config' dance. 

 

OK, but HOW do i have to change /etc/conf.d/apache2 so that apache2 loads the php-module???

----------

## lx

I run mod_php 4.3.0pre2 (think because else squirrelmail wouldn't work or something)

I think what I did was added

```
LoadModule php4_module modules/modules/libphp4.so
```

somehow my custom ebuild installs libphp4 in /usr/lib/apache2/modules instead of /usr/lib/apache2, so you should check where yours is.

I added index.php I think to DirectoryIndex, not needed but still convenient

also added:

Addtype application/x-httpd-php .php

But I screwed around some time before I got it working, so maybe I overlooked other changes,

Cya lX.

----------

## morck

thanks for this explanation ... it didn't help me though, because for whatever reason this doesn't work as well.

but i found a bug describing this problem:

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

and there is an ebuild attached, which should at least work.

but now i get some errors when i try to start apache2:

```
 * Starting apache2...

Syntax error on line 3 of /etc/apache2/conf/modules.d/50_mod_php.conf:

Can't locate API module structure `php_module' in file /etc/apache2/extramodules/libphp4.so: /usr/lib/libapr.so.0: undefined symbol: php_module
```

i hope that all this will be sorted out soon ....

cya morck

----------

## lx

 *morck wrote:*   

> but now i get some errors when i try to start apache2:
> 
> ```
>  * Starting apache2...
> 
> ...

 

I have /usr/lib/libapr.so.0 on my system and it's installed by apache2, i'm using 2.0.43-r1 btw. 

ps I had to uncomment one line in apache2.conf, cause some module (not related to php however) wasn't build.

Hope you fix it,

Cya lX.

ps. checking the bugs.gentoo.org, I see there's a revision after your post, although I don't know if this fixes your problem.

----------

## morck

i tried the different config-files from that bug, but every version produced the same error.

i even compiled apache and mod_php with less aggressiv cflags, but that also did not change anything ...

----------

## lx

Whoopsie made a booboo it seems that libphp4.so can't find the symbol php_module in libapr.so.0 library.......

The major changes I have with standard mod_php-4.2.3 apart from the version (4.3.0b) is that I use (for apache-2.0.43-r1),

--with-apxs2="/usr/sbin/apxs2 -ltiff" if this is wrong it probably crashes configure.

--with-exec-dir="/usr/sbin"

and I install the lib

in /usr/lib/apache2/modules/

ps. I have uninstalled Apache-1.3 (do you have both apache's installed?)

Cya lX.

----------

## morck

do i get you right, that you now have the same error???

ps: i only have apache-2.0.43-r1 installed.

----------

## lx

 *morck wrote:*   

> do i get you right, that you now have the same error???
> 
> ps: i only have apache-2.0.43-r1 installed.

 

No I meant I didn't read your posted error to well, it doesn't miss the lib but it states it misses a symbol "php_module", on my system it still works (squirrelmail still works), I don't have the error. Well seeing we have the same apache installed, I think that php-4.2.3 is probably not compatible.

http://dan.drydog.com/apache2php.html:

 *Quote:*   

> The older php-4.2.3 did not work with Apache 2.0.43

 

Well you could try to install a newer php as I did, but I still have some sandbox violation that I take for granted.

http://www.geocities.com/honey_jal/

states that 4.2.3 and apache 2.0.43 can be compiled........

Well I needed a newer version because the old php had many problems and had a bug in redirection that causes squirrelmail to fail....

Cya lX.

----------

## MoonWalker

Just a side step, but have any of you manage to get mod_perl compile with apache 2? I get an error:

```
make[1]: Entering directory `/var/tmp/portage/mod_perl-1.99.07/work/mod_perl-1.99_07/src/modules/perl'

test -f mod_perl.so && \

cp mod_perl.so /var/tmp/portage/mod_perl-1.99.07/image//usr/lib/apache2-extramodules

make[1]: Leaving directory `/var/tmp/portage/mod_perl-1.99.07/work/mod_perl-1.99_07/src/modules/perl'

make: *** No rule to make target `pure_vendor_install', needed by `pure_install'.  Stop.

!!! ERROR: dev-perl/mod_perl-1.99.07 failed.

!!! Function src_install, Line 38, Exitcode 2

!!! (no error message)

```

----------

## lx

 *MoonWalker wrote:*   

> Just a side step, but have any of you manage to get mod_perl compile with apache 2? I get an error:
> 
> 

 

Should beter post this as a new thread, but I think this is a common problem, don't know if I read it in the forum somewhere or on the net, but it looks familiar (but I use php). Maybe I've read your post https://forums.gentoo.org/viewtopic.php?t=25467  :Wink:  ps have you seen https://forums.gentoo.org/viewtopic.php?t=25049.

Cya lX.

----------

## MoonWalker

Yes yes, I know... desperate as I am lacking a solution I just thought to ask you as you both seam to run apache 2

I use php to, and guess I have had mod_perl there more or less as an old habbit, and some ppl sure does still use perl. Guess I can remove it for now and wait for it to be fixed.

----------

## vertex

I would think that someone with a little more knowledge than myself could hack the two Makefiles to get something working. The diffs are long, but the broken portion isn't that long. I'm attempting to massage my Makefile to work. This may be a dumb question, but is there a seperate ebuild command to configure and compile. It would make testing this problem a whole lot easier. 

Ryan

----------

## paul138

mod_php hit r1 today and builds with apache 2. Just dont be too dissapointed when it does'nt work properly   :Razz: 

----------

