Sunday, April 27, 2008

Configuring PHP in Apache 2 in Windows

1.

Install php and crate a dir in c:\php

and copy the unzipped file there

Copy all the dll's under php to c:\windows\system32

reanme php.ini-dist to php.ini and put it in path c:\windows for example

Also in php.ini add support to mysql

"As with enabling any PHP extension (such as php_mysql.dll), the PHP directive extension_dir should be set to the directory where the PHP extensions are located. See also the Manual Windows Installation Instructions. An example extension_dir value for PHP 5 is c:\php\ext"

2.
In the Apache httpd.conf
After

#ExtendedStatus On

Add

LoadModule rewrite_module modules/mod_rewrite.so
LoadModule php5_module "c:/php/php5apache2.dll"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4

Then set permission to
#
# This should be changed to whatever you set DocumentRoot to.
#


Options Indexes Includes FollowSymLinks MultiViews ExecCGI

AllowOverride All

Note - check the security risk here

Also note remove .php from AddHandler, otherwise you get errors from apache saying error 403 Forbidden

ScriptAlias /cgi-bin/ "D:/Program Files/Apache Group/Apache2/cgi-bin/"
AddHandler cgi-script .cgi .pl

No comments:

Install/Upgrade NVIDI Driver in Ubuntu for CUDA SDK

Most linux distribution comes with the Nouveau https://nouveau.freedesktop.org/wiki/ display driver configured. If you need to use NVIDIA...