Adding a VHOST and loosing PHP

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Adding a VHOST and loosing PHP

Postby benk » 07. January 2007 00:34

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!
benk
 
Posts: 3
Joined: 06. January 2007 23:59

solution!

Postby benk » 07. January 2007 12:12

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!
benk
 
Posts: 3
Joined: 06. January 2007 23:59


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 65 guests