Specifications

Note that with the AddType directive, you can specify how Apache should handle the various
file extensions. In the case previously mentioned, we specify that Apache treats any file con-
taining .php and .phtml as a PHP-interpreted file. You could, for example, treat regular .htm
and .html files as PHP scripts by adding the following directive:
AddType application/x-httpd-php .html
AddType application/x-httpd-php .htm
You will find more information about other directives that you can set in the configuration file
at the Apache Web site, http://www.apache.org.
Lets Test Our Work
Start Apache and test to ensure that you have PHP working. Create a test.php file and add the
following lines to it:
<? phpinfo() ?>
Make sure the file is in the document root directory of Apache and then pull it up on the
browser, as follows
http://localhost/test.php
or
http://your-ip-number-here/test.php
If you see a page similar to that shown in Figure A.2, you know that you have Apache and
PHP working together. Remember to test for MySQL working with them. Do this by writing a
simple PHP script to connect to the server and insert/extract some data on the database.
Adding PHP and MySQL to Microsoft IIS and PWS
This section will cover how to add PHP and MySQL support to IIS with the ISAPI
(php4isapi.dll) module. It assumes that you have read and installed MySQL as described in the
previous section.
The first thing you need to do is to install the DLLs as mentioned in the previous sectionthat
is, install the MSVCRT.DLL and PHP4TS.DLL to the Windows directory. Also make sure that
you know what to put into the test.php file as described previously.
Installation Notes for Microsoft IIS
Here are the cookbookprocedures for the installation of PHP in Microsoft Internet
Information Server:
1. Copy either the php.ini-dist or the php.ini-optimized file into your Windows direc-
tory, and rename it to
‘php.ini’. Change the defaults by modifying any of the directives
inside it.
Appendixes
P
ART VI
800
38 7842 app a 3/6/01 3:40 PM Page 800