Chapter 3. Installing Under Windows
Install PHP
1. Extract the PHP zip file to
c:\
and rename the install directory (ie. 'php5.0.1') to 'php'.
2. If using PHP 4, move the files in
c:\php\dlls
to
c:\php
.
3. Add the following to your Windows PATH environement variable
c:\php
. The Windows path can be accessed
via the Control Panel at: 'System', 'Advanced', 'Environment'.
4.
Add the following two environment variables to your system using the procedure above:
MIBDIRS=c:\php\mibs
, and
PHPRC=c:\php
.
5. If using PHP 4.3.5 or less (not recommended), create the following directory
c:\tmp
.
6. Rename the file
c:\php\php.ini.dist
to
php.ini
, and make the following changes to it:
If using PHP 4 add the following lines.
extension_dir = c:\php\extensions
extension=php_snmp.dll
extension=php_sockets.dll
If using PHP 5 add the following lines.
extension_dir = c:\php\ext
extension=php_mysql.dll
extension=php_snmp.dll
extension=php_sockets.dll
If using PHP 4.3.5 or less include the following line. If using 4.3.6 or greater, you should remove this line if
present.
session.save_path=c:\tmp
7. If you have had previous versions of PHP installed, you had likely moved the PHP system files to in the Win
dows directory structure. If so, you will have to remove those files. Please review your PHP installation docu
mentation for instructions on removing those files.
Configure the Webserver (Apache)
1. Make sure you have stopped any IIS web servers before you proceed with Apache installation.
2. Install the Apache web server. This is as simple as double clicking the .msi file and following the prompts. Make
sure to install it as a service and for the sake of the HOWTO, install it to
c:\apache
or
c:\apache2
.
3. If you are using Apache 1.3.x, installation of PHP 5 is not recommended. If using PHP 4, add the following lines
to your
httpd.conf
file in the
c:\apache\conf
directory:
LoadModule php4_module c:\php\sapi\php4apache.dll
AddModule mod_php4.c
AddType application/x httpd php .php
DirectoryIndex index.html index.htm index.php
4. If you are using Apache 2.x, add the following lines to your
httpd.conf
file in the
c:\apache2\conf
directory:
If using PHP 4, then add the following lines.
LoadModule php4_module c:\php\sapi\php4apache2.dll
AddType application/x httpd php .php
DirectoryIndex index.html index.htm index.php
If using PHP 5, then add the following lines.
LoadModule php5_module c:\php\php5apache2.dll
AddType application/x httpd php .php
DirectoryIndex index.html index.htm index.php
Configure the Webserver (IIS)
1. Start the Microsoft Management Console, right click on Default Web Site (in most cases) and select Properties.
2. Under the Home Directory tab, select Configuration and click Add. Browse to the path of
php4isapi.dll
or
php5isapi.dll
, and type in .php as the extension.
3
<
New Page 1
Php Mysql Web Hosting