After installing PHP and a webserver on Windows, you will probably want to
install some extensions for added functionality. You can choose which
extensions you would like to load when PHP starts by modifying your
php.ini. You can also load a module dynamically in your script using
dl().
The DLLs for PHP extensions are prefixed with php_.
Many extensions are built into the Windows version
of PHP. This means additional DLL files, and the
extension directive, are
not used to load these extensions. The Windows
PHP Extensions
table lists extensions that require, or used to require, additional PHP
DLL files. Here's a list of built in extensions:
The default location PHP searches for extensions is
C:\php4\extensions in PHP 4 and
C:\php5 in PHP 5. To change this
setting to reflect your setup of PHP edit your php.ini file:
You will need to change the
extension_dir setting to
point to the directory where your extensions lives, or where you have
placed your php_*.dll files. For example:
extension_dir = C:\php\extensions
Enable the extension(s) in php.ini you want to use by uncommenting the
extension=php_*.dll lines in php.ini. This is done
by deleting the leading ; from the extension you want to load.
Example 6-8. Enable Bzip2 extension for PHP-Windows
// change the following line from ...
;extension=php_bz2.dll
// ... to
extension=php_bz2.dll
Some of the extensions need extra DLLs to work. Couple of them can be
found in the distribution package, in the
C:\php\dlls\ folder in PHP 4 or
in the main folder in PHP 5, but some, for example Oracle
(php_oci8.dll) require DLLs which are not bundled
with the distribution package. If you are installing PHP 4, copy the
bundled DLLs from C:\php\dlls
folder to the main C:\php
folder. Don't forget to include C:\php in the system
PATH (this process is explained in a separate FAQ entry).
Some of these DLLs are not bundled with the PHP distribution. See each
extensions documentation page for details. Also, read the manual
section titled Installation of PECL
extensions for details on PECL. An
increasingly large number of PHP extensions are found in
PECL, and these extensions require a
separate download.
Note:
If you are running a server module version of PHP
remember to restart your webserver to reflect your changes to php.ini.
The following table describes some of the extensions available and required
additional dlls.