View previous topic :: View next topic |
Author |
Message |
MadBassist Apprentice
Joined: 10 Apr 2004 Posts: 200
|
Posted: Tue May 11, 2004 12:15 pm Post subject: apache 2 and php |
|
|
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 |
|
|
yngwin Retired Dev
Joined: 19 Dec 2002 Posts: 4572 Location: Suzhou, China
|
Posted: Tue May 11, 2004 12:26 pm Post subject: |
|
|
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 |
|
|
rmalolepszy Apprentice
Joined: 01 Jan 2004 Posts: 167
|
Posted: Tue May 11, 2004 12:26 pm Post subject: |
|
|
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 |
|
|
diskreet n00b
Joined: 10 Jun 2003 Posts: 62 Location: Nashua, NH
|
Posted: Tue May 11, 2004 12:59 pm Post subject: |
|
|
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 |
|
|
ric_man n00b
Joined: 01 Dec 2003 Posts: 26 Location: Melbourne, Australia
|
Posted: Tue May 11, 2004 2:11 pm Post subject: |
|
|
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:
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 |
|
|
Erythro73 Tux's lil' helper
Joined: 20 Jan 2004 Posts: 78 Location: Saint-Jean-sur-Richelieu, Québec
|
Posted: Tue Aug 03, 2004 12:40 am Post subject: |
|
|
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:
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 |
|
|
intgr Apprentice
Joined: 23 Jun 2004 Posts: 225 Location: Earth, Sol, Milky Way
|
Posted: Tue Aug 03, 2004 2:37 am Post subject: |
|
|
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 |
|
|
tomk Bodhisattva
Joined: 23 Sep 2003 Posts: 7221 Location: Sat in front of my computer
|
|
Back to top |
|
|
|