# Apache2 not showing php

## Rune

So I made a test file ver.php with the phpinfo code in it and when I try to go to it in my browser it just displays the text in that file. So for the hell of it I went to a page that didn't exist on my server just to see what kind of error I would be getting and I get.

Not Found

The requested URL /ver.ph was not found on this server.

Apache/2.0.47 (Gentoo/Linux) PHP/4.3.2 mod_ssl/2.0.47 OpenSSL/0.9.6i Server at localhost Port 80

Now I don't know a heck of alot about how Apache works and I probly never will. But to me this seems to be telling me that Apache knows PHP/mod_ssl/OpenSSL are running and working fine.

The contents of the 70_php.... file is in my /etc/conf.d/apache2 file. And my apache2.conf file has the LoadModule lines for both ssl and php. Am I doing something just blatantly retarded and that's why it's not working?

Edit: adding more info since I have no idea what people would need to help me.

error.log shows: (when i restart apache)

[Sat Jul 26 12:22:02 2003] [notice] Apache/2.0.47 (Gentoo/Linux) PHP/4.3.2 mod_ssl/2.0.47 OpenSSL/0.9.6i configured -- resuming normal operations

----------

## pYrania

have you set -D PHP or -D PHP4 in your /etc/conf.d/apache2?

It used to be -D PHP, but due to the upcoming release of php 5.0 they altered the way php is integreated into apache, so you have to set -D PHP4 now.

----------

## Rune

Oops I knew I forgot to post some info. Yes I have -D PHP4.

----------

## Tasslehoff

what do you have for mime-type set up for php?  if php is loading correctly that is all I can think of

----------

## Rune

i got everything pretty much generic except the loadmodule for php and ssl and it already points to 70_php... file by default.

----------

## Tasslehoff

so what happens if you add

AddType application/x-httpd-php .php 

to the .conf file?  (I think it is apache2.conf for apache2 isnt it?

----------

## god

 *Rune wrote:*   

> ...
> 
> The requested URL /ver.ph was not found on this server.
> 
> Apache/2.0.47 (Gentoo/Linux) PHP/4.3.2 mod_ssl/2.0.47 OpenSSL/0.9.6i Server at localhost Port 80
> ...

 

Tried using "ver.php" and not "ver.ph"?

----------

## Rune

hehe :p

that was me testing what the error page would show when i typed in a nonexistant url  :Very Happy: 

tassle: not yet but i'm having issues with the linux box freezing up in x. i think its because i accidently upgraded glibc and broke everything. i gonna re-compile the whole system in the next couple days since i've changed my CFLAGS pretty good. I'll try your suggestion in the morning. I've just spent a couple hours figuring out why in windows my system spontaneously rebooted after 10 minutes. Turns out motherboard monitor even after uninstalled still watches the system from the registry. (i screwed up the sensors to monitor and it thought my system was always overheating)

----------

## hygge

these lines to my apache.conf file made mod_php work:

LoadModule php4_module extramodules/libphp4.so

Include conf/addon-modules/mod_php.conf

----------

## Rune

 *hygge wrote:*   

> 
> 
> LoadModule php4_module extramodules/libphp4.so
> 
> 

 

Already have that file in there. That's what seems to be making php load. I believe Tasslehoff is right with the AddType stuff

----------

## pYrania

the applicationtype stuff should be set in /etc/apache2/conf/modules.d/70_mod_php.conf

----------

## Rune

Tasslehoff was correct but i had to add that into mime.types  :Very Happy: 

----------

## jgrimm73

The LoadModule directive seemed to work with apache 1.3.27 but I got errors with apache 2.0.47 when trying to load the same module.  /etc/init.d/apache2 restart told me it couldn't load the libphp4.so due to libq.so missing???

I'm unmerging and remerging apache now with this command:

USE="-X -java -qt mysql apache2 perl" emerge unmerge apache2 && emerge -uc apache2

I looked through all the documented USE variables I could find.  Does anyone know of a USE variable that might indicate setting build arguments to include php support similar to what there is for perl?  If this is possible then apache2.conf may emerge in with the correct syntax to load php without any further editing.

I've seen the -D switch in other posts, does this plus the mime type lines seem to be working?  Could someone post apache2.conf excerpts for php4 support.  Any idea when php5 will be released?

Thanks,

----------

## indros

Are you adding <?php ?> around your code?

For example:

```
<?php phpinfo(); ?>
```

----------

## muhsinzubeir

This is the version of my firefox, en im bizzi learning php as a summer fun.But im wondering that all my .php pages arent being displayed by this firefox.

 *Quote:*   

> www-client/mozilla-firefox-2.0.0.1

 

I created .php documents called test.php with this code:

```

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<h2>Welcome!</h2>

<?php

    echo "<p>dynamic output</p>";

?>

<p>static output </p>
```

Open test.php with firefox,I get firefox detected a php script what should it do.2 options save it to a file or open it with text editor... :?En Im learning php, i want to see what happens on the browser...

Edit:

Never mind, silly me  :Very Happy: 

----------

## nixnut

merged above post here.

----------

