Re: can not load php pages, webserver runnning apache 1.3 an…

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Kevin Brown
Date:  
To: plug-discuss
Subject: Re: can not load php pages, webserver runnning apache 1.3 and php4
> I am running Debian, apache 1.3 and php4 and I seem to have all the
> necessary packages installed but when I go to a page on the apache
> server that is a php page firefox asks if I would like to open or save
> the file and if I want to open it what program do I want to use to open
> it with, so it seems that apache is not serving up the php correctly.
>
> I have the following installed:
>
> libapache-mod-php4
> apache 1.3 Version 1.3.33-6
> php4


OK, well, guess you are lacking the directive in apache's config (and
this will apply for apache2 as well) to get it to send pages of
extensions like .php through the php parser first. What apache is doing
right now is sending the php files unparsed and firefox doesn't know the
extension to know what to do with it (doesn't have a matching content
type in firefox).

FROM http://www.php.net/manual/en/install.unix.php

Apache 1.3.x config:

14. Edit your httpd.conf to load the PHP module.  The path on the right hand
     side of the LoadModule statement must point to the path of the PHP
     module on your system.  The make install from above may have already
     added this for you, but be sure to check.


     For PHP 4:


       LoadModule php4_module libexec/libphp4.so


     For PHP 5:


       LoadModule php5_module libexec/libphp5.so


15. And in the AddModule section of httpd.conf, somewhere under the
     ClearModuleList, add this:


     For PHP 4:


       AddModule mod_php4.c


     For PHP 5:


       AddModule mod_php5.c


16. Tell Apache to parse certain extensions as PHP.  For example,
     let's have Apache parse the .php extension as PHP.  You could
     have any extension(s) parse as PHP by simply adding more, with
     each separated by a space.  We'll add .phtml to demonstrate.


       AddType application/x-httpd-php .php .phtml


     It's also common to setup the .phps extension to show highlighted PHP
     source, this can be done with:


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


17. Use your normal procedure for starting the Apache server. (You must
     stop and restart the server, not just cause the server to reload by
     using a HUP or USR1 signal.)



APACHE 2.x config:

14. Edit your httpd.conf to load the PHP module.  The path on the right hand
     side of the LoadModule statement must point to the path of the PHP
     module on your system.  The make install from above may have already
     added this for you, but be sure to check.


     For PHP 4:


       LoadModule php4_module libexec/libphp4.so


     For PHP 5:


       LoadModule php5_module libexec/libphp5.so


15. Tell Apache to parse certain extensions as PHP.  For example,
     let's have Apache parse the .php extension as PHP.  You could
     have any extension(s) parse as PHP by simply adding more, with
     each separated by a space.  We'll add .phtml to demonstrate.


       AddType application/x-httpd-php .php .phtml


     It's also common to setup the .phps extension to show highlighted PHP
     source, this can be done with:


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


16. Use your normal procedure for starting the Apache server, e.g.:

       /usr/local/apache2/bin/apachectl start
---------------------------------------------------
PLUG-discuss mailing list - 
To subscribe, unsubscribe, or to change  you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss