Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
apache 2 and php
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Duplicate Threads
View previous topic :: View next topic  
Author Message
MadBassist
Apprentice
Apprentice


Joined: 10 Apr 2004
Posts: 200

PostPosted: Tue May 11, 2004 12:15 pm    Post subject: apache 2 and php Reply with quote

well now ive found apache2 and the conf files how do i setup apache2 and php to work together, the conf file looks different to 1.3.x versions tho i mgiht just be imagining it?
_________________
System
---------
AMD Athlon XP 2800 Barton
512 Corsair XMS LLPT DDRRAM
Nvidia GeForce FX5900
Audigy2
gentoo-dev-sources 2.6.8-r3
Back to top
View user's profile Send private message
yngwin
Retired Dev
Retired Dev


Joined: 19 Dec 2002
Posts: 4563
Location: Suzhou, China

PostPosted: Tue May 11, 2004 12:26 pm    Post subject: Reply with quote

You need to emerge mod_php with the apache2 use flag.
_________________
"Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF
Back to top
View user's profile Send private message
rmalolepszy
Apprentice
Apprentice


Joined: 01 Jan 2004
Posts: 167

PostPosted: Tue May 11, 2004 12:26 pm    Post subject: Reply with quote

What version do you have?

Later versions of apache2 automatically read mod_ files from a specific directory. Therefore, emerge apache mod_php will work out of the box.
_________________
Cheers,
Ryan
Back to top
View user's profile Send private message
diskreet
n00b
n00b


Joined: 10 Jun 2003
Posts: 62
Location: Nashua, NH

PostPosted: Tue May 11, 2004 12:59 pm    Post subject: Reply with quote

I'm not sure what they're talking about I had to add lines to my config files manually.. let me reference the php manual for ya:

Quote:
14. Edit your httpd.conf to load the PHP module. The path on the right hand
side of the LoadModule statement must point to the path of the PHP
module on your system. The make install from above may have already
added this for you, but be sure to check.

For PHP 4:

LoadModule php4_module libexec/libphp4.so

For PHP 5:

LoadModule php5_module libexec/libphp5.so

15. Tell Apache to parse certain extensions as PHP. For example,
let's have Apache parse the .php extension as PHP. You could
have any extension(s) parse as PHP by simply adding more, with
each separated by a space. We'll add .phtml to demonstrate.

AddType application/x-httpd-php .php .phtml

It's also common to setup the .phps extension to show highlighted PHP
source, this can be done with:

AddType application/x-httpd-php-source .phps


Naturally on Gentoo the conf file is /etc/apache2/apache2.conf not httpd.conf, other than that those commands should set ya straight.

Have Fun.
Back to top
View user's profile Send private message
ric_man
n00b
n00b


Joined: 01 Dec 2003
Posts: 26
Location: Melbourne, Australia

PostPosted: Tue May 11, 2004 2:11 pm    Post subject: Reply with quote

I don't know if it's due to things being updated while the post above was made, but I fould my conf file in:
Code:
/etc/apache2/conf/apache2.conf

and the lines I added were:
Code:
LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

since I found that libphp4.so had "moved".

To install it, all I typed was:
Code:
emerge mod_php

and portage downloaded and installed it all like that.

Hope this is of some assistance to others, and not just my weird install.

...Ric
_________________
Running Gentoo as a desktop on a Toshiba Satellite P20 (P25 to some of you). Learning heaps!
Back to top
View user's profile Send private message
Erythro73
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jan 2004
Posts: 78
Location: Saint-Jean-sur-Richelieu, Québec

PostPosted: Tue Aug 03, 2004 12:40 am    Post subject: Reply with quote

ric_man wrote:
I don't know if it's due to things being updated while the post above was made, but I fould my conf file in:
Code:
/etc/apache2/conf/apache2.conf

and the lines I added were:
Code:
LoadModule php4_module modules/libphp4.so
AddType application/x-httpd-php .php .phtml
AddType application/x-httpd-php-source .phps

since I found that libphp4.so had "moved".

To install it, all I typed was:
Code:
emerge mod_php

and portage downloaded and installed it all like that.

Hope this is of some assistance to others, and not just my weird install.

...Ric


Yes it was for me. The only difference was the path, that is /usr/lib/apache2-extramodules/libphp4.so
Back to top
View user's profile Send private message
intgr
Apprentice
Apprentice


Joined: 23 Jun 2004
Posts: 225
Location: Earth, Sol, Milky Way

PostPosted: Tue Aug 03, 2004 2:37 am    Post subject: Reply with quote

This should already be a FAQ. Did change /etc/conf.d/apache2? If you didn't, you should add this line:
Code:

APACHE2_OPTS="-D PHP4"

(If you already have APACHE2_OPTS defined, make sure you don't override them, but just append '-D PHP4' to the end)
And restart apache by doing:
Code:

# /etc/init.d/apache2 restart
Back to top
View user's profile Send private message
tomk
Bodhisattva
Bodhisattva


Joined: 23 Sep 2003
Posts: 7221
Location: Sat in front of my computer

PostPosted: Thu Aug 05, 2004 12:36 pm    Post subject: Reply with quote

Moved from Networking & Security, please see this topic:

https://forums.gentoo.org/viewtopic.php?t=104806
_________________
Search | Read | Answer | Report | Strip
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Duplicate Threads 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