I've got Apache 2.2 working, and my virtualhosts work within the following directories:
C:/www (main Apache root)
C:/www/vhosts (virtual hosts)
However, I cannot get PHP files to function outside of vhosts, even if the domain works well as a virtual host.
Example domain:
<VirtualHost *:80>
ServerName testweb1.co.uk
ServerAlias www.testweb1.co.uk
DocumentRoot /www/testweb1.co.uk
ErrorLog /www/Apache22/logs/error.log
<Directory "/www/testweb1.co.uk">
Options All
AllowOverride All
order allow,deny
allow from all
</Directory>
I tried a PHP file with a simple include, two files in the directory:
<?php include("header.php"); ?>
It worked within C:/www/vhosts but outside of it, no PHP code was displayed.
Here's my vhosts-conf, well, the beginning:
<Directory C:/www/>
Order Deny,Allow
Allow from all
</Directory>
<Directory C:/www/mytest61>
Order Deny,Allow
Allow from all
</Directory>
Why is this and what can be done? PHP scripts won't execute in either of them.
I don't want all my virtualhosts in one directory; what's the best solution for this?
<Dir /www/vhosts>, then PHP would only function inside that directgory. – Marc B Jul 8 '11 at 14:32AddType application/x-httpd-php .phpandLoadModule php5_module modules/libphp5.somain Apache root configuration. – tftd Jul 9 '11 at 3:07