The installation instructions at the beginning of this book detailed a simple configuration of PHP. If you feel like venturing out on your own by adding additional extensions (on Windows) or recompiling PHP (on Linux), this appendix gives you a brief rundown of some of your options. PHP can be as powerful or as streamlined as you want it to be, but a general rule of thumb is only to add functionality that you really need. For example, if you have no plans for connecting to an Oracle database, you do not need to enable support for the Oracle functions. But PHP is very extendable, meaning you can add functionality whenever you want—like if your company decides to buy an Oracle license!
Basic functionality is already built into PHP binary distributions for Windows, including:
|
· |
Regular expression support |
|
· |
Dynamic library support |
|
· |
Internal sendmail support |
|
· |
Perl-compatible regular expression support |
|
· |
ODBC support |
|
· |
Session support |
|
· |
XML support |
|
· |
MySQL support |
and much more!
To get additional functionality, you must use additional extensions (.dll files), over 40 of which are included with the distribution. Some of the more popular extensions are listed in Table A.1.
|
Filename |
Description |
|---|---|
|
php_cpdf.dll |
Enables ClibPDF functions |
|
php_curl.dll |
Enables CURL-related functions |
|
php_gd2.dll |
Enables GD library image functions |
|
php_ifx.dll |
Enables Informix functions |
|
php_ldap.dll |
Enables LDAP functions |
|
php_mhash.dll |
Enables mhash functions |
|
php_ming.dll |
Enables Ming-related Macromedia Flash functions |
|
php_mssql.dll |
Enables Microsoft SQLServer functions |
|
php_oci8.dll |
Enables Oracle 8+ functions |
|
php_openssl.dll |
Enables OpenSSL functions |
|
php_pgsql.dll |
Enables PostgreSQL functions |
|
php_sybase_ct.dll |
Enables Sybase functions |
To turn an extension "on," you must modify your php.ini file.
Open php.ini in a text editor and find the following lines:
; Directory in which the loadable extensions (modules) reside. extension_dir = ./
Change the second line so that it points to the directory containing your extensions, such as
extension_dir = /php/extensions
Next, find a section that starts like this:
;Windows Extensions
For each extension you want to use, take away the semicolon before the name of the file in the list.
If the file is not in the list, add it:
extension=[your_extension_name].dll
After changing anything in the php.ini file, restart the web server and then check the output of phpinfo() to verify your changes.
For more information on the Windows configuration options in PHP, please see the PHP manual's section on installation and configuration.