# new apache 2 & php

## thriftweed

Hi everyone,

I've been trying, for the past few hours, to get the php module running on the new apache 2 installation that comes with the current gentoo. I believe I've done everything required to get it running, i.e. emerged apache and mod_php, and configured /etc/conf.d/apache2 to include the line 

APACHE2_OPTS="-D PHP4"

but it's still no good: The webserver starts, but php is not working. php scripts inside a html file are ignored, loading php scripts directly causes the browser to want to download the file...

I'm out of ideas: I've re-emerged apache, php, mod_php, but no go. I've also had an extensive look at the upgrade instructions at http://www.gentoo.org/doc/en/apache-upgrading.xml , but nothing there seems to solve my problem (then again, apache is running.. it's just not doing the php stuff).

Another thing i've tried is this:

http://svn.gnqs.org/projects/gentoo-php-overlay/file/docs/php-upgrading.html?format=raw#doc_chap2

However, when I unmerge dev-php/php and mod_php, and try to emerge dev-lang/php, i get this:

# emerge dev-lang/php

Calculating dependencies

!!! All ebuilds that could satisfy "dev-lang/php" have been masked.

!!! One of the following masked packages is required to complete your request:

- dev-lang/php-4.4.0-r1 (masked by: ~x86 keyword)

- dev-lang/php-4.3.11-r1 (masked by: ~x86 keyword)

- dev-lang/php-5.0.5-r1 (masked by: ~x86 keyword)

- dev-lang/php-5.0.4-r1 (masked by: ~x86 keyword)

Anyway, I'm all out of ideas... little help here, please:-)

----------

## Maedhros

Moved from Installing Gentoo to Networking & Security.

----------

## Tain

Try adding ACCEPT_KEYWORDS="~x86" in your /etc/make.conf

----------

## j-m

 *Tain wrote:*   

> Try adding ACCEPT_KEYWORDS="~x86" in your /etc/make.conf

 

No! That's why we have /etc/portage/package.keywords...   :Exclamation: 

----------

## Samyne

I'm facing the same problem  :Sad: 

Everything works with apache but he will not let me show php pages. If I want to see a php page he gives me the error "Cannot show this page" in IE in Firefox he gives me a 404 page not found and links gives me "Error reading from socket".

----------

## Transcendent

I've got the same problem.

----------

## Hanzz

Same problem here too

----------

## agouti

Did you forget the "apache2" use flag for dev-php/mod_php package ? for me, it created  etc/apache2/module.d/70_mod_php.conf file who was  missing after apache2 remerge.

----------

## opopanax

Also, you may be running php just fine, but the system doesn't know that .php means run a php doc.  Check your mime.types files (/etc/mime.types, and the one in the apache config dirs.)

----------

## whyscream

The best option to follow is simply follow the 'Upgrading PHP' howto at http://svn.gnqs.org/projects/gentoo-php-overlay/file/docs/php-upgrading.html.

It will explain you how to unmask the officially still unstable ('~arch') dev-lang/php package and it's updated companions, and how not to run into troubles by colliding with the older ebuilds. When you run into messages like 

```
- dev-lang/php-5.0.5-r1 (masked by: ~x86 keyword)
```

then you just didn't follow the howto: it tells you to place packages in /etc/portage/package.keywords to avoid those errors.

----------

## huehnerhose

I had the same problem after updating apache.

I deleted whoel /etc/apache2 reinstalled apache2 and mod_php and changed the config-directory-search in /etc/init.d/apache2 from "/etc/apache2/conf/apache2.conf" to "/etc/apache2/httpd.conf" as it seems to be the new way of configuring apache. (I had to admit, that I didn't read the upgrade-guide)

After this steps I configured everyting necessary. Now everything is interpreted right by apache2/php.

P.S. I'm not sure if I reemerged "dev-php/php" too. But I'm sure that I was confused with dev-php/php and dev-lang/php and that dev-lang/php isn't installed on my server

----------

## Ossymoon

Has anyone found a fix for this that didn't have to do with reinstalling apache?

----------

## Ossymoon

I reemerged php and mod php according to here and how i have squirrelMail giving an error on the $sessionid

Any ideas?

----------

## Dinini

Sounds like you left out the "session" use flag.  The recommended use flags are very close to the functionality that php used to be configured with in php4 binaries from php.net and should support most existing scripts that did not require custom compiles of php.

----------

