Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mod_php4.c - where is it?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
KraGorn
n00b
n00b


Joined: 17 Apr 2002
Posts: 40
Location: Warrington, England

PostPosted: Fri Apr 19, 2002 7:42 pm    Post subject: mod_php4.c - where is it? Reply with quote

According to what I've read here and in the O'Reilly PHP4 book I'm supposed to have a mod_php4.c file but I can't find one on my system. Where do I get it from?

So far I've done

emerge php
emerge apache

but there's still no LoadModule in the apache.conf ... hence my question about apacheaddmod in another thread ... and both apacheaddmod and the instructions in O'Reilly clearly say I need this mod_php4.c file. I've got mod_php4.conf in addon-modules and libphp4.so in /usr/lib/apache-extramodules but this .c file is nowhere to be found.
_________________
You'll never catch ME using a sig.!
Back to top
View user's profile Send private message
zend
Tux's lil' helper
Tux's lil' helper


Joined: 10 Apr 2002
Posts: 112
Location: Shanghai,China

PostPosted: Sat Apr 20, 2002 1:32 am    Post subject: Reply with quote

just add
Loadmodule php4_module extramodules/mod_php4.so
AddModule mod_php4.c

to apache.conf
everything is ok
Back to top
View user's profile Send private message
KraGorn
n00b
n00b


Joined: 17 Apr 2002
Posts: 40
Location: Warrington, England

PostPosted: Sat Apr 20, 2002 8:52 am    Post subject: Reply with quote

zend wrote:
just add
Loadmodule php4_module extramodules/mod_php4.so
AddModule mod_php4.c

to apache.conf
everything is ok


No it isn't! As I just pointed out I don't HAVE a mod_php4.c on my system, so when I come to try to start Apache it fails because it can't find it :(
_________________
You'll never catch ME using a sig.!
Back to top
View user's profile Send private message
klieber
Administrator
Administrator


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Sat Apr 20, 2002 11:54 am    Post subject: Reply with quote

KraGorn wrote:

No it isn't! As I just pointed out I don't HAVE a mod_php4.c on my system, so when I come to try to start Apache it fails because it can't find it :(


Hmmm...I'm not sure, but I don't think mod_php4.c is supposed to exist as a separate file -- I believe it's compiled into libphp4.so, which is then loaded by apache.

I have a Debian server that has apache and php4 running perfectly on it. Doing the following:

X5:/# find / -name mod_php4.c

Yields no results. So I don't have that file on my system, either, but PHP is working fine.

So, as the other poster suggested, try adding the LoadModule command and then the AddModule command and see if that works.

If that doesn't work, then we're going to need some more information -- what are your apache logs telling you? (/var/log/apache/error.log, depending on what logging system you have installed and how you have apache configured) Also, does apache by itself work OK? (i.e. can it serve up plain html files without a problem?)

--kurt
_________________
The problem with political jokes is that they get elected
Back to top
View user's profile Send private message
KraGorn
n00b
n00b


Joined: 17 Apr 2002
Posts: 40
Location: Warrington, England

PostPosted: Sat Apr 20, 2002 1:21 pm    Post subject: Reply with quote

Well, all I was doing was what someone else told me ... "go to php.net" ... where I found this:

Quote:

./configure --with-apache=/path/to/apache_source --with-pgsql
This will create a libmodphp4.a library, a mod_php4.c and some accompanying files and copy this into the src/modules/php4 directory in the Apache source tree.


and since there's a IfDefModule reference to mod_pdp4.c in the addons-/mod_php.conf it's kind of intuitive I *need* it ... hence my question. Is there no reference to this is your .conf?

As for the error, it's along the lines of:

fopen failed
unable to find /etc/apache/addon-modules/mod_php4.c

at the point I enter

# apache start

I've got round it my grabbing the mod_php4.c out of the php source tree but clearly that's not supposed to be the way it works.

Appreciate your trying to help, it seems no-one else has *this* problem wiath Apache+PHP but many people have *some* problems getting these two to work together :cry:
_________________
You'll never catch ME using a sig.!
Back to top
View user's profile Send private message
klieber
Administrator
Administrator


Joined: 17 Apr 2002
Posts: 3657
Location: San Francisco, CA

PostPosted: Sat Apr 20, 2002 1:48 pm    Post subject: Reply with quote

KraGorn wrote:

and since there's a IfDefModule reference to mod_pdp4.c in the addons-/mod_php.conf it's kind of intuitive I *need* it ... hence my question. Is there no reference to this is your .conf?


Of course there's a reference to it in my httpd.conf. I have two lines related to php:

Code:
LoadModule php4_module /usr/lib/apache/1.3/libphp4.so
Addmodule mod_php4.c


Note that this is on a debian system, so it likely won't be the same for a gentoo system -- your modules may be in a different location. However, the Addmodule line should be the same.

When I say you won't have a mod_php4.c file, it's because (I think) it's compiled into libphp4.so. If you look at the instructions you referenced on php.net, I think you'll see that those relate to compiling php and apache -- not configuring an already-compiled system.

Try this:

  • Find your libphp4.so module. Note its full path
  • Enter that into your httpd.conf file, just as I've done above, except substituting your correct path to libphp4.so
  • Enter the AddModule command exactly as I have it listed above. No path -- just "AddModule mod_php4.c"
  • Restart apache

Now, I imagine you're still going to have trouble because it sounds like your php and/or apache is not compiled right -- so don't be surprised if this still doesn't work. However, if you do have trouble, then look in your apache error log and post the exact error message that you're getting. That will help determine where your problem is.

Also, assuming it still doesn't work, try commenting out those two php lines -- can you then start apache and serve up regular html files?

--kurt
_________________
The problem with political jokes is that they get elected
Back to top
View user's profile Send private message
KraGorn
n00b
n00b


Joined: 17 Apr 2002
Posts: 40
Location: Warrington, England

PostPosted: Sat Apr 20, 2002 4:19 pm    Post subject: Reply with quote

Kurt, first, a big "thanks" for sticking with me here, especially as I was more than a little stroppy :oops:

Okay, I completely removed both packages and re-emerged them, then knowing that "/var/tmp/pkg/phpwhateveritis config" doesn't update appache.conf properly I manually changed it and added the reference to mod_php4.c ... and it now works.

I really don't understand how you can tell Apache to AddModule a file that doesn't exist but at least it isn't complaining any more and I can now serve up a page with a simple phpinof() call in it :)

Once again, I'm very grateful ... hopefully someone will fix the non-functioning auto-update of apache.conf and installing these packages will be as easy and painless as the rest of gentoo has proven to be ... okay, next stop Samba.

Cheers

Robin
_________________
You'll never catch ME using a sig.!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum