Page 1 of 1

Adding a VHOST and loosing PHP

PostPosted: 07. January 2007 00:34
by benk
Hey all,

I would like to migrate my current websites from windows to xammp,
so i tried making som VHOSTs appended to the bottom of httpd.conf
and they work fine. Except that the php files get parses på PHP.

The php souce is with mysql passwords and all is served.

I havn't touched any other conf parameters.. just appended
these line to the bottom of httpd.conf

what did i do wrong here?

Code: Select all
NameVirtualHost *:80

<VirtualHost *:80>
DocumentRoot /opt/lampp/htdocs
ServerName default
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /opt/lampp/htdocs/dir1
ServerName domain1.com
</VirtualHost>

<VirtualHost *:80>
DocumentRoot /opt/lampp/htdocs/dir2
ServerName domain2.com
</VirtualHost>



any help very appreciated!

solution!

PostPosted: 07. January 2007 12:12
by benk
After googling for ~10 hours i found a solution here:
step 11 at :

http://dan.drydog.com/apache2php.html

Code: Select all
# Make sure there's only **1** line for each of these 2 directives:
# Use for PHP 4.x:
#LoadModule php4_module        modules/libphp4.so
#AddHandler php-script   php

# Use for PHP 5.x:
LoadModule php5_module        modules/libphp5.so
AddHandler php5-script php

# Add index.php to your DirectoryIndex line:
DirectoryIndex index.html index.php

AddType text/html       php

# PHP Syntax Coloring
# (optional but useful for reading PHP source for debugging):
AddType application/x-httpd-php-source phps



By just adding the above, you can now easily just
add Virtualhost to the end for you httpd.conf as my first post
and the *.php files will parse!