httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Hartburn" <dave-c...@samndave.org.uk>
Subject RE: [users@httpd] php files displayed as 'text'
Date Fri, 16 Mar 2007 09:09:29 GMT

You should not need the AddModule. I suspect your PHP files were appearing
as text as you have not associated the .php extension with the PHP
interpreter.

The following should be enough to get you going (taken from CentOS):
#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#

LoadModule php4_module modules/libphp4.so

#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddType application/x-httpd-php .php
# AddType application/x-httpd-php-source .phps

#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php

----file ends-------

Note the path on LoadModule, you probably want to change it to
libexec/httpd/libphp4.so. Double check where your module is stored on your
particular setup.

Dave Hartburn




> At 02:37 PM 3/15/2007, Mark Lavi wrote:
>>You should insure that PHP module available and loaded.
>>
>>If you compiled it in as a static module, you can look at the httpd -l
>>option to see if it is there.
>>Otherwise, you can enable mod_status to check your configuration in real
>>time.
>
> Ok, I think I found part of the problem. Following directions at
> http://www.php.net/manual/en/install.macosx.php
>
> In the section with all the other LoadModules:
>    LoadModule php4_module       libexec/httpd/libphp4.so</div>
>
> Directly below that section should be the AddModules; you need:
>    AddModule mod_php4.c
>
>
> The LoadModule is fine, but when I uncomment AddModule, I get
>
> Syntax error on line 159 of /Library/Apache2/conf/httpd.conf:
> Invalid command 'AddModule', perhaps misspelled or defined by a
> module not included in the server configuration
>
> Is this no longer correct?
>
> Now it no longer shows a php as text, but just 'hangs' when I load a php
> page.
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>


-- 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message