Re: a couple questions about virtual hosts in Apache

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2007-08-13 at 11:00 -0500, Scott wrote:
> Does this conform to AddType correctly?
> AddType script/php .php
>  
> Also where should this be placed in the VirtualHost directive?

Do you have a /etc/httpd/conf.d/php.conf file?  If so, you shouldn't
have to do something like the above.  I'll attach what one of mine looks
like, below.  Note that it's for FC5, since that's the box that I'm on
at the moment, but you should be able to see the sort of thing it is,
and check that yours has something similar (i.e. checking commented out
portions between them).

And, it would have been an AddHandler directive to make it work, along
with a LoadModule.  You don't send the PHP script out as a file, you get
Apache to handle the file, parsing it, and generating an output.  But,
as I said, this should have been taken care of already.

#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#

LoadModule php5_module modules/libphp5.so

#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler php5-script .php
AddType text/html .php

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

#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
#AddType application/x-httpd-php-source .phps

-- 
(This box runs FC5, my others run FC4 & FC6, in case that's
 important to the thread.)

Don't send private replies to my address, the mailbox is ignored.
I read messages from the public lists.


[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux