PHP_IIS 6.0 | PHP_Apache2 |TroubleShooting | Install Program

Install PHP5x on Window Server 2003 IIS 6.0

STEP1

1. Download (PHP 5.1.2 zip package) and install PHP
2. Configure PHP (lots of php.ini editing)
3. Configure IIS (lots of pointing and clicking in IIS Manager)
4. Test it! (checking to make sure PHP is working on your server)

STEP2

Rename/copy php.ini-recommended to php.ini (C:\php)
Edit php.ini (modify 3 variables)

doc_root ="c:\Inetpub\wwwroot"
extension_dir = "C:\php\ext"
cgi.force_redirect = 0

Move php.ini to C:\Windows|Winnt\ System32 (system root directory)

STEP3

Set up IIS so that IIS will serve PHP scripts. (PHP5 : php-cgi.exe , PHP4: php.exe)

a. IIS->Web Service Extension ->Add web service extenstion-> Type in PHP and point to C:\php\php-cgi.exe

b. IIS ->Default Website-> Properties-> Home Directory tab-> Configuration->
Add extention: php path: C:\php\php-cgi.exe

STEP4

Reboot webserver (click on rect button on IIS stop/restart)
a. To stop the web sever enter: Net stop iisadmin
b. To restart the web server enter: Net start w3svc

STEP5

Testing : <?php phpinfo(): ?> (phpinfo.php)

 

Install PHP4 on Window Server 2003 with Apache

STEP1

MOVE FOLLOWING FILE TO C:/APACHE2/
C:\php\php4ts.dll
C:\php\sapi\php4apache2.dll
C:\php\php.ini-recommended


Configuring PHP C:/php/pho.ini-recommended -->php.ini )

a .register_globals = On // global variable ON

b. SMTP SERVER

[mail function]
; For Win32 only.
SMTP = localhost

For Win32 only.
sendmail_from = me@localhost.com

c. doc_root=C:/Apache2/htdocs

STEP2

Running PHP as an Apache module (c:\Program Files\Apache group\Apache\conf\httpd.conf)
ScriptAlias /php/" c:/php"

LoadModule php4_module "c:/php/php4apache.dll" // after a series of comment loadmodule

AddModule mod_php4.c //t specifies the order in which the various modules are enabled by the Apache server.

AddType application/x-httpd-php .php //add ext you wnt apache to recognise as php script
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .phtml

Action application/x-httpd-php "/php/php.exe" //tell the server to execute the PHP
executable each time it encounters a PHP
script

Enable PHP5

Add following line in .htaccess
AddHandler x-httpd-php5 .php

STEP3
Testing Your PHP Installation
Save phpinfo.php in htdocs

<? phpinfo() ; ?>

STEP4

1 Start Apache Server . /usr/local/apache2/bin/apachectl start

Troubleshooting
1. You are not authorized to view this page. You do not have permission to view this directory or page using the credentials you supplied.
-IIS>Default Website> Properties>Directory Security> Anonymous access Edit> Checked 'Integrated Windows authetication'

Installation ( more info)

1. Extract file (NOT DIR ) from Compressed Archive file
- tar zxvf http-2.tar.gz
2. cd http-2
3. ./configure --prefix=PREFIX
Install architecture-independent files in PREFIX. By default the installation directory is set to /usr/local/apache2.
4. make
5. make install