Specifications

side-effect of the Windows port. Apache 2.0 is making progress to implement the
expected asynchronous behavior, and we hope to discover that the NT/2000 implementa-
tion enables CGIs to behave as documented.
If you need to enable Apache with SSL in Windows, you will need to compile the Apache
source code. Refer to the Apache.org, OpenSSL.org, and ModSSl.org sites for more informa-
tion on how to do this, or look at the UNIX installation for reference. Its not difficult, but will
require more work.
Installing PHP for Windows
Okay, now we are ready to install PHP for Windows. Make sure you stop Apache before you
start the PHP installation process. The process is extremely simple if you understand that,
unlike PHP 3, PHP 4 is divided into several components, which require that several DLLs be
used. That is, you cant run PHP in its CGI mode as a standalone executable. You must ensure
that the DLLs in the distribution exist in a directory (any directory) that is in the Windows
path. The easiest way to do this is to copy these DLLs to your SYSTEM (Windows 9x) or
SYSTEM32 (Windows NT) directory, which is under your Windows directory. The DLLs that
need to be copied are MSVCRT.DLL (it might already be there) and PHP4TS.DLL.
We have provided the outline here as a cookbookinstallation guide. You should have no
problem installing and setting up PHP in your Windows machine, if you follow it.
1. Start by copying the php.ini-dist to your ‘%WINDOWS%’ directory and rename it to
‘php.ini’. The ‘%WINDOWS%’ variable usually points to C:\WINDOWS for Windows 9x and
C:\WINNT for NT servers.
2. Edit the php.ini file and change the extension_dir setting to point to the directory con-
taining the DLL modules for the extensions. Set the doc_root to point to the Web servers
document root, that is, the outside visible root directory of the server.
3. Uncomment out in the
php.ini file the modules you would like to load when PHP starts.
Uncomment the
extension=php_*.dll lines to load the modules. Note that some mod-
ules require additional libraries installed on the system for the module to work correctly.
Also note, that MySQL support is now built in to PHP 4; it doesnt require loading via
this method.
Now all you need to do is edit the httpd.conf file in the Apache conf directory to configure
Apache to work with the PHP CGI binary. Add the following directives to the config file.
ScriptAlias /php/ “c:/path-to-your-php-dir/”
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
Action application/x-httpd-php “/php/php.exe
Installing PHP 4 and MySQL
A
PPENDIX A
A
INSTALLING PHP 4
AND MYSQL
799
38 7842 app a 3/6/01 3:40 PM Page 799