PHP configuration for Apache on Windows


Requires 2 lines in httpd.conf:
LoadModule php5_module "C:/php/php5apache2_2.dll"
AddType application/x-httpd-php .php

Virtual Host

Modify 'hosts' file under C:\WINDOWS\system32\drivers\etc\
127.0.0.1   foo.bar
Insert once in httpd-vhosts.conf:
NameVirtualHost *:80

# Parent folder containing all virtual host folders/sites

    DirectoryIndex index.html index.php

    # ExecCGI allows cgi execution
    Options Indexes FollowSymLinks ExecCGI 

    # Allow over riding directives for individual virtual hosts through .htaccess
    AllowOverride All 

    # For local machine development, deny from all users except localhost
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1

    # Maps .pl files as cgi files
    AddHandler cgi-script .pl

Repeat for each virtual host in httpd-vhosts.conf:

    ServerName foo.bar
    DocumentRoot "C:/Documents and Settings/sanjib/My Documents/vhost/foo.bar/www"




Write a Comment


Your Name:
Your Email:
Comment: