php files not running in apache

If none of the more specific forums is the right place to ask

php files not running in apache

Postby pghollis » 2005-10-21 08:09

Hi,

I'm having problems running php scripts.

I have apache running OK. It will run cgi scripts no problems. I have PHP installed, but when I try running a test php script, my browser says it doesn't know how to handle the file and asks for the appliication to use or to download the file. ie. APACHE doesn't seem to run the PHP file. I'm trying to access my php file using the following in my browser:

http://localhost/index.php

This index.php file has the following in it:

<HTML>
<HEAD>
<TITLE>PHP Test</TITLE>
<BODY BGCOLOR="white">

<?
= phpinfo();
echo ;
?>

</BODY>
</HTML>


I have the following set in the httpd.conf file:

DirectoryIndex index.html index.htm index.shtml index.cgi index.php

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps


I've also added:

AddHandler php-script .php

but still nothing.


Information on the appache setup:

/usr/sbin/apache -V gives:
erver version: Apache/1.3.33 (Debian GNU/Linux)
Server built: Sep 6 2005 13:10:30
Server's Module Magic Number: 19990320:16
Server compiled with....
-D EAPI
-D HAVE_MMAP
-D HAVE_SHMGET
-D USE_SHMGET_SCOREBOARD
-D USE_MMAP_FILES
-D HAVE_FCNTL_SERIALIZED_ACCEPT
-D HAVE_SYSVSEM_SERIALIZED_ACCEPT
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D DYNAMIC_MODULE_LIMIT=64
-D HARD_SERVER_LIMIT=4096
-D HTTPD_ROOT="/usr"
-D SUEXEC_BIN="/usr/lib/apache/suexec"
-D DEFAULT_PIDLOG="/var/run/apache.pid"
-D DEFAULT_SCOREBOARD="/var/run/apache.scoreboard"
-D DEFAULT_LOCKFILE="/var/run/apache.lock"
-D DEFAULT_ERRORLOG="/var/log/apache/error.log"
-D TYPES_CONFIG_FILE="/etc/mime.types"
-D SERVER_CONFIG_FILE="/etc/apache/httpd.conf"
-D ACCESS_CONFIG_FILE="/etc/apache/access.conf"
-D RESOURCE_CONFIG_FILE="/etc/apache/srm.conf"

/usr/sbin/apache -l gives:

ompiled-in modules:
http_core.c
mod_so.c
mod_macro.c
suexec: disabled; invalid wrapper /usr/lib/apache/suexec


Any help with would be appreciated.

Regards Paul.
pghollis
 
Posts: 2
Joined: 2005-10-21 07:43

Postby vrtisworks » 2005-10-21 12:25

Which version of PHP do you have installed? There are seperate packages for the CGI and the MOD-PHP

Nick
vrtisworks
 
Posts: 4
Joined: 2005-10-20 23:19

Postby pghollis » 2005-10-22 00:26

Hi Nick,

thanks for the reply, but I think I've found my problem.

When restarting linux I noticed:

apache restarted OK
Apache2 failed to restart with the following message Apache2 (98) Address already in use....

In other words I had two versions of apache installed and only the earlier version was being started.

I uninstalled apache and Apache2, then reinstalled Apache2 alone.

This seems to have done the trick.

Hope this helps any others having the same sort of problem.

Regards Paul.
pghollis
 
Posts: 2
Joined: 2005-10-21 07:43


Return to General Questions

Who is online

Users browsing this forum: No registered users and 14 guests

fashionable