# apache 2.0.54-r31 and php trouble

## massheep

Hi

I updated my gentoo server yesterday and it happend that php isn't working anymore.

apache2_opts contains "-D PHP4", configs are ok.

Strange: when I put back my old configuration than php still doesn't work.

What is wrong?

----------

## llongi

Did you read the Apache upgrade docs, wich state you have to reemerge all Apache modules you use?

So please reemerge mod_php, and make sure the new version you're emerging is mod_php-4.4.0-r3.

Best regards, CHTEKK.

----------

## massheep

apache, php and mod_php had updates at the same time...

but i killed them and reemerge them right now. let's see how it works in a few hours.

----------

## llongi

Remember to emerge sync before rebuiling all.  :Smile:  Maybe you got the old, not yet updated version of mod_php the last time you did that.

Best regards, CHTEKK.

----------

## massheep

i had a look at my emerge.log file and indeed, first apache-2.0.54-r31 (updating -r15) then php-4.4.0-r1 (updating 4.4.0) and then mod_php-4.4.0-r3 (updating 4.4.0) have been updated; so it keeps me confusing why php didn't work but after the recompilation it does  :Smile: 

----------

## cpdsaorg

my php is still NOT working after rebuilding apache, php, mod_php and restarting everything including the whole server several times.

Will the REAL php.ini please stand up?

```
# locate php.ini

/etc/apache2/conf/php.ini

/etc/php/cli-php4/php.ini

/etc/php/apache2-php4/php.ini

```

Where do you call the php_mod module to load with the new config?? 

```
/etc/apache2/modules.d/70_mod_php.conf
```

doesn't load and in /etc/apache2/httpd.conf:

```
Include /etc/apache2/modules.d/*.conf
```

 is not commented out.

I moved the old apache config file away like it said to do and I tried revdep-rebuild and I am at this point stumped.

How do you check which modules apache loads?? I really need to get this fixed.

----------

## massheep

did you check your /etc/conf.d/apache2 file? it get's overwritten when you tell etc-update to take over with update. in the new file "-D PHP4" is missing such that the module wont be loaded. check for this:

APACHE2_OPTS="-D DEFAULT_VHOST -D PHP4"

cheers

----------

## Crisis

I'm having the same problem and I've checked all above ideas.  Can anyone else help??

----------

## Crisis

I had to load a mime module that I had always had commented out before, that fixed it

----------

## Lars

Simply clear firefox cache fixes my problems.   :Embarassed: 

Really stupid behaviour.

Regards

Lars

----------

## gullyf

I did a fresh install and simply could not get php to work. After playing around for the last couple of days, I started dropping in erroneous values to see what was going on. It would appear from my experimentation that the config file with APACHE2_OPTS simply isn't being read. If I comment out the <ifdefined PHP4> statement from the 70_mod_php.conf everything works fine, while bad statements in  /etc/conf.d/apache2 cause no errors. It also explains why I had to specify the DocumentRoot in httpd.conf, while it should have been picked up by the DEFAULT_VHOST define.

So why isn't the conf.d/apache2 file being read (CONFIGFILE in /etc/init.d/apaches2 is set to /etc/apache2/httpd.conf?), and if it isn't supposed to be, where should APACHE_OPTS be defined? It errors in the httpd.conf file...

----------

## Crisis

Did you make sure to run etc-update after the newest version of apache was installed and let it install the new init scripts in init.d?

----------

## rawbear

Worked for me after adding -D PHP4 in /etc/conf.d/apache2 AND getting out and back into Firefox (effectively clearing the cache...)

----------

## Bad Penguin

 *massheep wrote:*   

> Hi
> 
> I updated my gentoo server yesterday and it happend that php isn't working anymore.
> 
> apache2_opts contains "-D PHP4", configs are ok.
> ...

 

I am experiencing the exact same problem.  The php module will not load, no matter how correct the config files are.  I tried everything, including loading the module directly from httpd.conf with the full path to the module - no go.  Config tests showed no errors, enabling debugging options and adding a startup error log file gave little information other than a ! when attempting to load the module.  I was attempting to migrate from apache 1 to 2, along with the new config file format, so it could possibly be a config file problem that the config test is missing?

I ended up backing off to apache 1.

----------

