You are not logged in.

#1 2009-05-25 12:51:03

AP81
Member
Registered: 2006-10-01
Posts: 36

Apache not serving PHP pages ...

Hi,

I've installed Apache and PHP and PHP pages are not working.

I've stuck a simple file (index.php) in the apache web directory:

<?php
echo 'test';
?>

If I navigate to http://localhost I get no apache page, just a directory listing.  If I click index.php, it only displays the file contents.

Error Log:
[Mon May 25 23:38:34 2009] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
[Mon May 25 23:38:34 2009] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon May 25 23:38:34 2009] [notice] Digest: generating secret for digest authentication ...
[Mon May 25 23:38:34 2009] [notice] Digest: done
[Mon May 25 23:38:35 2009] [notice] Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8k DAV/2 configured -$
[Mon May 25 23:38:42 2009] [error] [client 127.0.0.1] File does not exist: /srv/http/favicon.ico
[Mon May 25 23:38:45 2009] [error] [client 127.0.0.1] File does not exist: /srv/http/favicon.ico

Access Log:
127.0.0.1 - - [25/May/2009:23:38:42 +1000] "GET / HTTP/1.1" 200 954
127.0.0.1 - - [25/May/2009:23:38:42 +1000] "GET /icons/blank.gif HTTP/1.1" 200 148
127.0.0.1 - - [25/May/2009:23:38:42 +1000] "GET /icons/text.gif HTTP/1.1" 200 229
127.0.0.1 - - [25/May/2009:23:38:42 +1000] "GET /icons/unknown.gif HTTP/1.1" 200 245
127.0.0.1 - - [25/May/2009:23:38:42 +1000] "GET /favicon.ico HTTP/1.1" 404 1050
127.0.0.1 - - [25/May/2009:23:38:45 +1000] "GET /favicon.ico HTTP/1.1" 404 1050
127.0.0.1 - - [25/May/2009:23:38:48 +1000] "GET /index.htm HTTP/1.1" 200 52
127.0.0.1 - - [25/May/2009:23:38:51 +1000] "GET /index.php HTTP/1.1" 200 34
127.0.0.1 - - [25/May/2009:23:45:28 +1000] "GET / HTTP/1.1" 200 559

Does this look like an issue with the Session Cache?  I've never seen this error from a default Arch install.

Offline

#2 2009-05-25 13:10:08

seppo0010
Member
From: Buenos Aires
Registered: 2009-02-14
Posts: 12

Re: Apache not serving PHP pages ...

Stupid question, but have you installed PHP and restarted apache after that?

To open your index.php by default, you need to have some apache conf line like this "DirectoryIndex index.php index.html".
To process PHP you need to have loaded the handler ("AddHandler application/x-httpd-php .php") and the php module ("LoadModule php5_module modules/libphp5.so").

Offline

#3 2009-05-25 13:10:24

ArchArael
Member
Registered: 2005-06-14
Posts: 504

Re: Apache not serving PHP pages ...

Did you add in the /etc/httpd/conf/httpd.conf the line:

LoadModule php5_module modules/libphp5.so

http://wiki.archlinux.org/index.php/LAMP

Offline

#4 2009-05-26 00:17:09

AP81
Member
Registered: 2006-10-01
Posts: 36

Re: Apache not serving PHP pages ...

No, I've never had to do that before- I've only ever set up LAMP servers on Debian systems (which seem to have that set up by default).

I'll check the settings as per the Wiki (duh...I should have read the Wiki before posting!).

Cheers.

Offline

#5 2009-05-26 08:14:59

ckristi
Member
From: Bucharest, Romania
Registered: 2006-11-21
Posts: 225

Re: Apache not serving PHP pages ...

Reading your server signature: "Apache/2.2.11 (Unix) mod_ssl/2.2.11 OpenSSL/0.9.8k DAV/2 configured" I'd presume PHP is either not installed or not enabled in your config. Another option may be a patch that prevents PHP from adding to the Apache signature (I think Suhosin does that).

Another thing to look at would be to have "index.php" mentioned in the DirectoryIndex option from the apache config file.


In love I believe and in Linux I trust

Offline

#6 2009-05-26 08:55:05

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,224
Website

Re: Apache not serving PHP pages ...

AP81 wrote:

No, I've never had to do that before- I've only ever set up LAMP servers on Debian systems (which seem to have that set up by default).

I'll check the settings as per the Wiki (duh...I should have read the Wiki before posting!).

If you haven't followed the wiki and added the appropriate 'include' directive to httpd.conf then that will be your problem.

Offline

#7 2009-05-26 14:14:14

AP81
Member
Registered: 2006-10-01
Posts: 36

Re: Apache not serving PHP pages ...

fukawi2 wrote:

If you haven't followed the wiki and added the appropriate 'include' directive to httpd.conf then that will be your problem.

That was it.

Offline

Board footer

Powered by FluxBB