[NTLUG:Discuss] Getting php working with Apache.

Rob Apodaca rapodaca at raacc.com
Sat Jul 10 19:39:56 CDT 2004


On Sat, 2004-07-10 at 18:33, Jay Urish wrote:
> At 05:57 PM 7/10/2004, you wrote:
> >I've been running a simple web site off my home server/firewall PC for a 
> >couple
> >of years now and I'd like to add a Wiki and forum system - which seems to 
> >imply
> >a need to get php going (so I can install phpBB and phpWiki).
> >
> >However, I don't seems to be having any success.  I installed php according
> >to instructions and added the couple of lines to the http.conf that's 
> >recommended,
> >but '.php' documents from my server still come out as ASCII text when I 
> >view them
> >in a browser.
> 
> >Can anyone suggest any common mistakes I might have made?   Is there a way to
> >test php independently of it's connection to Apache?  (eg can I make it do 
> >something
> >from the command line?)

Most Distros are different in the way they layout the apache
configuration but, basically, you'll need something like this in your
apache configuration:

# Load the module first
<IfModule !mod_php4.c>
    LoadModule php4_module    extramodules/libphp4.so
</IfModule>
                                                                                
# Set it to handle the files
<IfModule mod_mime.c>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .phtml
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php-source .phps
</IfModule>

Of course, modify to suit your installation.

Cheers,
-Rob




More information about the Discuss mailing list