Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Apache2+php.........one more time.
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
squealie
n00b
n00b


Joined: 06 Aug 2003
Posts: 45

PostPosted: Fri Oct 17, 2003 1:53 pm    Post subject: Apache2+php.........one more time. Reply with quote

Hi guys.

I am trying one last time to get this going before I abandon Gentoo for this project.

Working through the virt-mailhost how-to, and it leaves you on your own for the Apache php portion, I know it says to use Apache1, but 2 appearently works on the desktop how-to.

test.php = <? phpinfo() ?>
It doesn't render.

I HAVE:
APACHE2_OPTS= "-D PHP4 -D SSL"
In /etc/conf.d/apache2

What else can I check?
I have STFW and this forum and the above is the only advice I can find that seems relevant.
Please, I'm at my wits end here. :?
Back to top
View user's profile Send private message
squealie
n00b
n00b


Joined: 06 Aug 2003
Posts: 45

PostPosted: Fri Oct 17, 2003 2:42 pm    Post subject: Reply with quote

OK, I found another tidbit while Googling.

I hadn't set the Severname directive (which was the cause of this behavior for one person) but now I have, along with updating DNS records. Resolution OK, and I no longer get the 'could not determine servers FQDN message'.

It's still broke. 8O






.
Back to top
View user's profile Send private message
squealie
n00b
n00b


Joined: 06 Aug 2003
Posts: 45

PostPosted: Fri Oct 17, 2003 3:00 pm    Post subject: Reply with quote

More Googling......

========================================
On Gentoo, it is important to run the ebuild config once you've emerged Apache2
and PHP. As the manual says:

# emerge apache php mod_php
# ebuild /var/db/pkg/dev-php/mod_php-4.2.2-r1/mod_php-4.2.2-r1.ebuild config

Your version numbers might differ. Do a "emerge -s mod_php" to get the present
version number.

Then, remember to edit /etc/conf.d/apache2 and add/modify this line to look like
this (the SSL part is optional ofcourse):

APACHE_OPTS="-D SSL -D PHP4"
=========================================

I reran the ebuild config (I forgt that I had remerged mod_php :oops: )
I got this:

Due to some previous bloopers with PHP and slotting, you may have multiple copies of mod_php installed. Please look at the autoclean output at the end of the emerge and unmerge all but relevant copies.....

after emerge -p mod_php (I don't know if I'm on the right track here..)
I get:
[ ebuild R ] dev-php/mod_php-4.3.3-r1

Now I'm gonna try to figure out what that means.... :roll:
Back to top
View user's profile Send private message
MrPyro
Tux's lil' helper
Tux's lil' helper


Joined: 14 Aug 2003
Posts: 121
Location: Sheffield, England

PostPosted: Fri Oct 17, 2003 3:41 pm    Post subject: Reply with quote

That warning is done by default: it isn't based on any checking done to the system.

The ebuild config run basically adds a few lines to apache.conf to configure it for PHP
_________________
Back off man, I'm a computer scientist
Back to top
View user's profile Send private message
squealie
n00b
n00b


Joined: 06 Aug 2003
Posts: 45

PostPosted: Fri Oct 17, 2003 3:50 pm    Post subject: Reply with quote

MrPyro wrote:
That warning is done by default: it isn't based on any checking done to the system.

The ebuild config run basically adds a few lines to apache.conf to configure it for PHP


Thanks, I did suspect that after looking at the ebuild file.

So, I'm back where I started, which is, without a clue.
Back to top
View user's profile Send private message
raDeon
n00b
n00b


Joined: 13 Sep 2003
Posts: 58

PostPosted: Mon Oct 20, 2003 2:41 am    Post subject: Reply with quote

hi did you start apache with

Code:
apache2 -D PHP4


how come I have to type -D PHP4 at the end if I want PHP enabled? I want it to be enabled when i run /etc/init.d/apache2 start or something.
Back to top
View user's profile Send private message
darfsnuzal
n00b
n00b


Joined: 07 Aug 2003
Posts: 36

PostPosted: Mon Oct 20, 2003 4:43 am    Post subject: Reply with quote

I remember having a lot of trouble with apache + php. Now I'm not 100% certain that this was the exact cure, but I unemerged php, apache and mod_php and then only emerged apache and mod_php. That seemed to take care of the problem.

I believe if you do an emerge -p mod_php on a clean system it won't show "php" in the required list. That's what gave me the idea to unemerge php.

HTH.
_________________
"Born to Compile"
Back to top
View user's profile Send private message
squealie
n00b
n00b


Joined: 06 Aug 2003
Posts: 45

PostPosted: Mon Oct 20, 2003 5:42 pm    Post subject: Reply with quote

raDeon wrote:
hi did you start apache with

Code:
apache2 -D PHP4


how come I have to type -D PHP4 at the end if I want PHP enabled? I want it to be enabled when i run /etc/init.d/apache2 start or something.


That did it!

Thank you. :D

I don't know why, it doesn't work just putting the option in conf.d/apache2, but it did output this on startup:

[warn] module php4_module is already loaded, skipping

Thanks again, now I can at least get on with my server installation.
Back to top
View user's profile Send private message
RevJones
n00b
n00b


Joined: 16 Jul 2003
Posts: 1

PostPosted: Thu Oct 23, 2003 1:54 am    Post subject: Reply with quote

I had a similar problem getting apache to load the php mod. It worked with if I did
Code:
apache2 -D PHP4

but not if I added the option to the config file /etc/conf.d/apache2. After double checking the file I found that I had forgotten to remove the comment mark! :oops:
Works now. :)
Back to top
View user's profile Send private message
tom
Tux's lil' helper
Tux's lil' helper


Joined: 11 Jun 2002
Posts: 83
Location: Guildford, UK

PostPosted: Mon Nov 03, 2003 2:04 pm    Post subject: Reply with quote

squealie wrote:
I don't know why, it doesn't work just putting the option in conf.d/apache2, but it did output this on startup:
[warn] module php4_module is already loaded, skipping


Has anyone figured out why this should be? I'm experiencing the same thing: I have add the "-D PHP4" option explicitly on the command line. Why won't it pick it up in /etc/conf.d/apache2? Weird.
Back to top
View user's profile Send private message
squealie
n00b
n00b


Joined: 06 Aug 2003
Posts: 45

PostPosted: Thu Nov 13, 2003 3:21 pm    Post subject: Reply with quote

Quote:

Has anyone figured out why this should be? I'm experiencing the same thing: I have add the "-D PHP4" option explicitly on the command line. Why won't it pick it up in /etc/conf.d/apache2? Weird.


Bump for any new info?
Back to top
View user's profile Send private message
elvis38
n00b
n00b


Joined: 26 Oct 2003
Posts: 20
Location: Madrid, Spain

PostPosted: Tue Nov 25, 2003 6:35 pm    Post subject: Reply with quote

squealie wrote:
Quote:

Has anyone figured out why this should be? I'm experiencing the same thing: I have add the "-D PHP4" option explicitly on the command line. Why won't it pick it up in /etc/conf.d/apache2? Weird.


Bump for any new info?


Did you remove the # from the begining of the line in etc/conf.d/apache2 ?

Worked for me... :wink:
Back to top
View user's profile Send private message
MeBrains
n00b
n00b


Joined: 05 Nov 2003
Posts: 22

PostPosted: Tue Nov 25, 2003 7:30 pm    Post subject: Reply with quote

I have the same problem as well....

have not found a solid answer from no one yet although I searched the board several times for this already.

works from prompt, does not work with APACHE_OPTS... :?
Back to top
View user's profile Send private message
elvis38
n00b
n00b


Joined: 26 Oct 2003
Posts: 20
Location: Madrid, Spain

PostPosted: Wed Nov 26, 2003 9:48 am    Post subject: Reply with quote

Humm. You'd have to check the conf files, but I am assuming something went wrong on your machine during the emerge.

If it helps, this is what I did:
1. emerge sync
2. emerge phpmyadmin (this is what I really wanted)
3. edited /etc/conf.d/apache2 as per above (-D PHP4).
4. rc-update add apache2 default

I didn't have php, mod_php or apache2 emerged when I started.
Back to top
View user's profile Send private message
sgarcia
Apprentice
Apprentice


Joined: 21 May 2003
Posts: 254
Location: Bakersfield, CA

PostPosted: Fri Nov 28, 2003 3:53 am    Post subject: Reply with quote

Quote:
Humm. You'd have to check the conf files, but I am assuming something went wrong on your machine during the emerge.


My guess is that something went wrong during the config update. I emerged mod_php and apache2 to the most current versions quite some time ago, but was too lazy to update the config files. I was installing a PHP package tonight and it was working fine.

In the middle of the install of a subsidiary package unrelated to PHP I decided to clean up the 46 config files portage had been telling me I urgently had to update, so while ImageMagick was compiling, I "cleaned up" my config files.

When I restarted apache, PHP was dead. If I put "-D PHP4" in /etc/config.d/apache2, nothing happens. If I start using
Code:
apache2 -D PHP4
nothing happens.

I like Gentoo's portage system, but its init scripts are a nightmare to deal with. They are convoluted and nasty. Rather than be ashamed of the ugly things like any sane person would be, the developers seem to be proud of them.

Why do we have to deal with "defines" at startup? It's SO much easier just to have the damned module listed in the ONE httpd.conf and be able to just use the apachectl that CAME with apache. Sheesh!

I just unmerged apache, php and mod_php and now the machine is grinding away reinstalling them. We'll see if anything works when I'm done. But if I *do* get it running again, I'm going to think very seriously before I do any more updates. This isn't the first time that "updating" startup scripts has broken things for me.

I would *NEVER* recommend Gentoo for anything important. It makes a fine desktop -- I've had better luck getting a nice customized desktop machine set up than with any other distribution I've tried. But this screwed up init/configuration maze is just too unreliable to use in the real world.
Back to top
View user's profile Send private message
To
Veteran
Veteran


Joined: 12 Apr 2003
Posts: 1145
Location: Coimbra, Portugal

PostPosted: Fri Nov 28, 2003 10:10 am    Post subject: Reply with quote

sgarcia wrote:
My guess is that something went wrong during the config update. I emerged mod_php and apache2 to the most current versions quite some time ago, but was too lazy to update the config files.

One of the main problems on linux, ppl just don't read the manuals and don't edit the conf files.
sgarcia wrote:
I was installing a PHP package tonight and it was working fine.

In the middle of the install of a subsidiary package unrelated to PHP I decided to clean up the 46 config files portage had been telling me I urgently had to update, so while ImageMagick was compiling, I "cleaned up" my config files.

That's because you did a auto-update, you should read carefully the warning befour;)
I usually backup my /etc when I'm updating configure files, something may happend etc etc
sgarcia wrote:

When I restarted apache, PHP was dead. If I put "-D PHP4" in /etc/config.d/apache2, nothing happens. If I start using
Code:
apache2 -D PHP4
nothing happens.
.....

If you had it running befour, then you did an etc-update and stop working the answer is easy, edit you config files!
sgarcia wrote:

I would *NEVER* recommend Gentoo for anything important. It makes a fine desktop -- I've had better luck getting a nice customized desktop machine set up than with any other distribution I've tried. But this screwed up init/configuration maze is just too unreliable to use in the real world.

I recomend gentoo speacially for important things. Why? cause you can decide what you want and how you want it.
Any other distribuion has a nice KDE skin or wahtever and ppl love it, but nothing gets close to gentoo's optimization options.

Fact is, even if you aren't an expert, gentoo and the help of this foruns are one of the finest resources to learn and develop linux skills.


_________________

------------------------------------------------
Linux Gandalf 3.2.35-grsec
Gentoo Base System version 2.2
------------------------------------------------
Back to top
View user's profile Send private message
bos_mindwarp
Apprentice
Apprentice


Joined: 19 Oct 2002
Posts: 275
Location: stockholm, sweden

PostPosted: Fri Nov 28, 2003 11:12 am    Post subject: Reply with quote

Last time I installed php, I forgot to add the file extensions part of apache.conf (portage doesnt do this for you).

Check this out:
http://www.php.net/manual/en/install.apache2.php

read the part about apache2 shared module instructions (example 3-6), paragraf 15.
Back to top
View user's profile Send private message
Frans
n00b
n00b


Joined: 27 Nov 2003
Posts: 13

PostPosted: Fri Nov 28, 2003 5:00 pm    Post subject: Reply with quote

bos_mindwarp wrote:
Last time I installed php, I forgot to add the file extensions part of apache.conf (portage doesnt do this for you).

uhm .... Like squealie said... Yes, portage will do that for you.. READ the output after a emerge!
squealie wrote:

ebuild /var/db/pkg/dev-php/mod_php-4.2.2-r1/mod_php-4.2.2-r1.ebuild config

Your version numbers might differ. Do a "emerge -s mod_php" to get the present version number.

Then, remember to edit /etc/conf.d/apache2 and add/modify this line to look like
this (the SSL part is optional ofcourse):

APACHE_OPTS="-D SSL -D PHP4"


Maybe ... just maybe APACHE2_OPTS works better....
Back to top
View user's profile Send private message
sgarcia
Apprentice
Apprentice


Joined: 21 May 2003
Posts: 254
Location: Bakersfield, CA

PostPosted: Mon Dec 01, 2003 8:01 pm    Post subject: Reply with quote

Quote:
sgarcia wrote:
Quote:
was installing a PHP package tonight and it was working fine.

In the middle of the install of a subsidiary package unrelated to PHP I decided to clean up the 46 config files portage had been telling me I urgently had to update, so while ImageMagick was compiling, I "cleaned up" my config files.


That's because you did a auto-update, you should read carefully the warning befour;)
I usually backup my /etc when I'm updating configure files, something may happend etc etc


Backing up /etc would probably have been a good idea. Where did you get the idea that I did an auto-update?

I did, however replace the apache startup script with the new one that came out.

Quote:
sgarcia wrote:

Quote:
I would *NEVER* recommend Gentoo for anything important. It makes a fine desktop -- I've had better luck getting a nice customized desktop machine set up than with any other distribution I've tried. But this screwed up init/configuration maze is just too unreliable to use in the real world.

I recomend gentoo speacially for important things. Why? cause you can decide what you want and how you want it.
Any other distribuion has a nice KDE skin or wahtever and ppl love it, but nothing gets close to gentoo's optimization options.


Gentoo has the potential to be a superb option for important things. However, the init system is convoluted and largely undocumented. Instead of a config file for Apache 2, you have half a dozen, spread out all over the file system. If you want to trace what's going on during startup, most of the "action" happens inside the bowels of runscript, which appears to be completely undocumented. You're completely at the mercy of whoever most recently rewrote the init script for your particular service, because you're never going to be able to trace it to see what he screwed up.

It also doesn't help that instead of having a config file for each service, there is a normal config file as well as one in /etc/conf.d (which may or may not have critical settings) as well as potentially other config files at the discretion of the Gentoo maintainer. As, for example, the module config stuff in /etc/apache2/conf/modules.d. I searched for 20 minutes before I found settings that normally reside in the httpd.conf hiding away in modules.d.

If Gentoo used standard SysV init scripts, or if the Gentoo init setup was a bit more transparent, so administrators could easily trace what was going on and customize it to their own needs (or fix what a developer screwed up) -- well, then I'd concede that Gentoo was ready for the big time. As it is, it's a crap shoot. Mostly things work well, but when they don't, it's a nightmare to fix. If there were documentation for the init process this would be a lot more acceptable.

The init scripts use /sbin/runscript as the shell. That's fine, as long as the shell functions and script language are documented. If there is documentation, it's well hidden.
Back to top
View user's profile Send private message
mallchin
l33t
l33t


Joined: 21 Jan 2003
Posts: 655
Location: United Kingdom

PostPosted: Wed Dec 10, 2003 2:26 am    Post subject: Reply with quote

elvis38 wrote:
squealie wrote:
Quote:

Has anyone figured out why this should be? I'm experiencing the same thing: I have add the "-D PHP4" option explicitly on the command line. Why won't it pick it up in /etc/conf.d/apache2? Weird.


Bump for any new info?


Did you remove the # from the begining of the line in etc/conf.d/apache2 ?

Worked for me... :wink:


LMAO, I must have setup many Apache+PHP installs but... :roll: ... I got caught out by the #

Thanks elvis!
_________________
6700 @ 2.66GHz, 4Gb RAM, 2 x 500Gb, 8800 GTX, PhysX, X-Fi, 24" Widescreen, Tux mascot
Back to top
View user's profile Send private message
korozion
n00b
n00b


Joined: 08 Dec 2003
Posts: 26
Location: Canada

PostPosted: Wed Dec 10, 2003 7:06 am    Post subject: Reply with quote

Well, I may have a weird one. I have -D PHP4 and -D SSL in the config file, php works great, but ssl will not.
Back to top
View user's profile Send private message
elvis38
n00b
n00b


Joined: 26 Oct 2003
Posts: 20
Location: Madrid, Spain

PostPosted: Wed Dec 10, 2003 9:07 am    Post subject: Reply with quote

korozion wrote:
Well, I may have a weird one. I have -D PHP4 and -D SSL in the config file, php works great, but ssl will not.


Korozion, I know it may be an obvious question but did you have ssl in your USE variables when you emerged apache?
Back to top
View user's profile Send private message
Oopsz
Guru
Guru


Joined: 08 Oct 2002
Posts: 340

PostPosted: Wed Dec 10, 2003 5:01 pm    Post subject: Reply with quote

Gentoo is fantastic on the server. it's intuitive. All the apache specific configuration is in /etc/apache/conf, all the run time changes go in /conf.d. And module ebuilds automagically add themselves to your apache.conf! Changing start up options is as easy as editing one line. What more could you want?

If you don't want full control of your system, go download red hat, I hear lots of people like that. They have nice graphical interfaces for everything, too. :twisted:
_________________
Pop-before-SMTP with the Gentoo Virtual Mailhosting Guide
Back to top
View user's profile Send private message
duhmmm
n00b
n00b


Joined: 13 Jan 2004
Posts: 4

PostPosted: Tue Jan 13, 2004 10:55 am    Post subject: apache2 and php... is the problem solved? Reply with quote

I just went though this last night....

Reading the thread it looks like many are typing "apache2 -D PHP4" at the commandline with success, but not not getting it to work with "apache2 -k start".

When you type "apache2...." at the commandline, you are not starting /etc/init.d/apache2, you actually run /usr/sbin/apache2, thus /etc/conf.d/apache2 is not used.

--- or maybe everyone had figured this out.
_________________
doh!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security 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