Programming PHPProgramming PHPSearch this book

Appendix B. Extension Overview

Contents:

Optional Extensions Listing

In addition to the functions from the standard extensions described in Appendix A, a number of optional extensions provide PHP with additional functionality. Generally, these optional extensions are interfaces to third-party code libraries. To use these functions, you need to install the libraries they depend on and recompile PHP with the appropriate compile-time directives.

This chapter is intended as a complete tour of the extensions provided with the PHP distribution, but not as a definitive reference to the functions provided by those extensions. Additional documentation for these extensions is available from the PHP web site http://www.php.net.

B.1. Optional Extensions Listing

The extensions are listed in this appendix in alphabetical order by extension name. Where necessary, the appropriate PHP compile-time directive is given for adding the extension to your PHP installation. Due to the fluid nature of the Web, locations are not given for downloading third-party libraries necessary to run the extensions; check the PHP web site for current download locations.

Apache

The Apache library contains functions specific to running PHP under Apache.

This library is available only if PHP is running under the Apache web server. To enable this extension, you must compile PHP with the --with-apache[=DIR] directive.

aspell

The aspell PHP library interacts with the aspell C library to check the spelling of words and offer suggestions for misspelled words. Because the aspell PHP library works only with very old versions of aspell, you should instead use the pspell library, which works with both pspell and later versions of aspell.

To use the aspell functions, you must install the aspell C library, Version 0.27 or earlier, and compile PHP with the --enable-aspell directive.

BCMath Arbitrary Precision Mathematics

If you need more precision in numbers than PHP provides by default with its built-in floating-point numbers, use the BCMath library. It provides support for arbitrary precision mathematics.

To use the BCMath functions, you must compile PHP with the --enable-bcmath directive.

bzip2 Compression

To read and write bzip2-compressed files, enable the bzip2 library.

To use the bzip2 functions, you must install the bzip2 or libbzip2 library, Version 1.0 or later, and compile PHP with the --with-bz2[=DIR] directive.

Calendar

The calendar library provides a number of functions for converting between various calendar formats, including the Julian Day Count, the Gregorian calendar, the Jewish calendar, the French Republican Calendar, and Unix timestamp values.

To use the calendar functions, you must compile PHP with the --enable-calendar directive.

CCVS

CCVS is a library for providing a conduit between your server and credit-card processing centers via a modem.

To use the CCVS functions, you must install CCVS and compile PHP with the --with-ccvs=[=DIR] directive. In addition, PHP and CCVS must run under the same user.

clibpdf

clibpdf provides functions to create documents in Adobe's PDF format on the fly. Unlike the free pdflib (see pdflib later in this appendix), clibpdf can create PDF files wholly in memory, without the use of temporary files, and can edit arbitrary pages within a multi-page document. See Chapter 10 for a detailed discussion of creating PDF documents.

To use the clibpdf functions, you must install clibpdf and compile PHP with the --with-clibpdf directive.

COM

The COM extension provides access to COM objects.

To enable the COM extension, you must install mSQL and compile PHP with the --with-com[=DIR] directive. It is available on Windows platforms only.

ctype

The ctype library provides functions to check whether or not characters and strings fall within various classifications, such as alphabetic characters or punctuation, taking the current locale into account.

To use the ctype functions, you must compile PHP with the --enable-ctype directive.

CURL

The CURL functions provide access to libcurl, a library that manages connections to servers via a number of different Internet protocols. CURL supports the HTTP, HTTPS, FTP, gopher, telnet, dict, file, and LDAP protocols; HTTPS certificates; HTTP POST, HTTP PUT, and FTP uploading; HTTP form-based uploading; proxies; cookies; and user authentication.

To use CURL functions, you must install CURL, Version 7.0.2-beta or later, and compile PHP with the --with-curl[=DIR] directive.

Cybercash

Cybercash is a provider of credit-card processing services. The Cybercash functions provide access to Cybercash transactions from PHP.

To use the Cybercash functions, you must install the Cybercash libraries and compile PHP with the --with-cybercash[=DIR] directive.

CyberMUT

CyberMUT is a financial transaction service from Crédit Mutuel.

To use CyberMUT, you must install CyberMUT and compile PHP with the --with-cybermut[=DIR] directive.

dBase

Although not recommended for use in production, the dBase library provides access to dBase-formatted database files, which are used in some Windows programs. Typically, you should use these functions only to import data from and export data to a dBase database.

To enable the dBase extension, you must compile PHP with the --enable-dbase directive.

DBM

For very simple database installations, you can use the DBM-style database library. These functions allow you to store records in simple database files. This library is essentially a subset of the DBM-style database abstraction library and is now deprecated.

To use these functions, you must compile PHP with the --with-db directive.

DBM-Style Database Abstraction

For very simple database installations, you can use the DBM-style database abstraction library. These functions allow you to store records in simple database files. The database files created through this library store simple key/value pairs and are not intended as replacements for full-scale relational databases.

To use these functions, you must install the appropriate library and compile PHP with the appropriate options: --with-dbm for original Berkeley database files (see DBM), --with-ndbm for the newer Berkeley database style, --with-gdbm for GNU's version of DBM, --with-db2 or --with-db3 for Sleepycat Software's DB2 and DB3, and --with-cdb for Cdb support.

dbx

The dbx extension provides a database abstraction layer for interacting with MySQL, PostgreSQL, Microsoft SQL Server, and ODBC databases. Using dbx, you can use a single set of functions to interact with any of these kinds of databases.

To use the dbx extension, you must compile PHP with the --enable-dbx directive. In addition, you must enable one or more database extensions that work with dbx.

DOM XML

The DOM XML library uses GNOME's libxml to create DOM-compliant object trees from XML files (and the reverse). DOM XML parsers differ from event-based parsers in that you point them at a file, and they give you a tree of various nodes. See Chapter 11 for a detailed discussion of using XML in PHP.

To enable the DOM XML extension, you must install GNOME libxml, Version 2.2.7 or later, and compile PHP with the --with-dom[=DIR] directive.

EXIF

The Exchangeable Image File Format (EXIF) extension provides a function to read the information stored on a device; many digital cameras store their information in EXIF format.

To use it, you must install EXIF and compile PHP with the --with-exif[=DIR] directive.

FDF

The Forms Data Format (FDF) is a library for creating forms in PDF documents and extracting data from or populating those forms. The FDF extension allows you to interpret data from an FDF-enabled PDF document or to add FDF form fields to a PDF document. See Chapter 10 for a detailed discussion of creating PDF documents.

To enable the FDF extension, you must install the FDF toolkit (FDFTK) and compile PHP with the --with-fdftk[=DIR] directive.

filePro

The filePro extension provides functions to allow read-only access to filePro database files.

To enable filePro support, you must compile PHP with the --enable-filepro directive.

FriBiDi

The FriBiDi extension provides functions to reorder Unicode strings based on the appropriate order for the encoded character set, such as left-to-right and right-to-left.

To use it, you must install the FriBiDi library and compile PHP with the --with-fribidi[=DIR] directive.

FTP

This extension provides access to remote file servers using FTP. Much of the functionality of this extension is provided by default in PHP's file-handling functions.

To enable this extension, you must compile PHP with the --enable-ftp directive.

gettext

The gettext library from GNU implements a Native Language Support (NLS) interface you can use to internationalize your application.

To enable the gettext extension, you must install gettext and compile PHP with the --with-gettext[=DIR] directive.

GMP

If you need more precision in numbers than PHP provides by default with its built-in floating-point numbers, you can use the GNU MP (GMP) library. It provides support for arbitrary precision mathematics.

The GMP library is not enabled by default. To use it, you must install GNU MP, Version 2.0 or later, and compile PHP with the --with-gmp[=DIR] directive.

Hyperwave

Hyperwave is a database for storing and managing documents. Documents of any type and size are stored, along with metadata (such as its title), in any number of languages.

To enable Hyperwave support, you must install Hyperwave, Version 4.1 or later, and compile PHP with the --with-hyperwave directive.

ICAP

ICAP servers provide central storage for calendar events. You can use either this extension or the MCAL extension (described later in this chapter) to access ICAP servers.

To use it, you must install the ICAP library and compile PHP with the --with-icap[=DIR] directive.

iconv

The iconv extension provides functions to convert strings between encodings.

To use it, your standard C library must have the iconv( ) function or you must install the libiconv library and compile PHP with the --with-iconv[=DIR] directive.

IMAP, POP3, and NNTP

Although PHP provides simple outbound emailing capabilities for reading messages from IMAP, POP, NNTP, and a local mailbox, you should add this extension to PHP.

To use it, you must install c-client and compile PHP with the --with-imap[=DIR] directive. Additionally, you may use the --with-kerberos[=DIR] option to enable Kerberos support and the --with-imap-ssl[=DIR] to enable SSL support for the IMAP extension.

Informix

This extension provides support for accessing Informix databases.

To enable the Informix extension, you must install Informix 7.0, Informix SE 7.0, Informix Universal Server (IUS) 9.0, or Informix 2000 or later and compile PHP with the --with-informix[=DIR] directive.

Ingres II

The functions provided in this extension allow you to access Ingres II databases.

To use these functions, you must install the Open API library and header files included with Ingres II and compile PHP with the --with-ingres[=DIR] directive.

InterBase

This extension provides support for accessing InterBase databases.

To enable this extension, you must install the InterBase client libraries and compile PHP with the --with-interbase[=DIR] directive.

IRC Gateway

The IRC gateway extension allows you to create a gateway between IRC servers and your PHP scripts.

To use it, you must install compile PHP with the --with-ircg directive.

Java

The Java extension allows you to create Java objects and to invoke methods on those objects from a PHP script.

To use it, you must have a JVM installed and compile PHP with the --with-java directive.

Kerberos

The Kerberos extension provides access to Kerberos authentication.

To use it, you must install Kerberos and compile PHP with the --with-kerberos[=DIR] directive.

LDAP

The Lightweight Directory Access Protocol (LDAP) allows you to retrieve data stored in hierarchical LDAP directories. Although the LDAP specification is fairly general, LDAP is typically used to access contact and company organization information.

To enable LDAP support in PHP, you must compile PHP with the --with-ldap[=DIR] directive.

MCAL

The Modular Calendar Access Library (MCAL) provides support for calendar events stored in an MCAL server. MCAL events can be stored in local files or in remote ICAP servers.

The MCAL library is not enabled by default. To use it, you must install the mcal or libmcal libraries and compile PHP with the --with-mcal[=DIR] directive.

mcrypt

This extension provides an interface to the mcrypt library, which provides encryption using a number of different algorithms, including (but not limited to) DES, Triple DES, and Blowfish.

To enable this extension, you must install mcrypt and compile PHP with the --with-mcrypt[=DIR] directive.

mhash

The mhash library is used to create checksums, message digests, message authentication codes, and so on. A number of algorithms, including MD5, GOST, and SHA1, are supported.

To use mhash functions, you must install mhash and compile PHP with the --with-mhash[=DIR] directive.

Microsoft SQL Server

This extension provides access to Microsoft SQL Server databases.

To enable this extension, you must install the Microsoft SQL Server client libraries and compile PHP with the --with-mssql[=DIR] directive.

Ming

Ming is a library that allows you to create Shockwave Flash movies. Ming provides support for most of Flash 4's features.

To enable this extension, you must install Ming and compile PHP with the --with-ming[=DIR] directive.

mnoGoSearch

The mnoGoSearch extension provides functions from the mnoGoSearch search engine. This library provides full-text indexing and searching for HTML, PDF, and text documents.

To use this extension, you must install mnoGoSearch and compile PHP with the --with-mnogosearch[=DIR] directive.

mSQL

Popular for simple, low-end deployments, mSQL is a database server. This extension provides support for accessing mSQL databases from PHP.

To enable the mSQL extension, you must install mSQL and compile PHP with the --with-msql[=DIR] directive.

MySQL

This extension provides support for accessing MySQL database servers. Because it is fast, simple, and lightweight, MySQL has gained great popularity in small deployments.

To use it, you must install the MySQL client libraries and compile PHP with the --with-mysql[=DIR] directive.

ODBC

The ODBC extension allows you to access databases that support ODBC. In addition, the extension supports connecting to several other databases that have adopted the semantics of ODBC.

To use ODBC, you must install the client libraries appropriate to the database you're trying to access and compile PHP with one of the following directives: --with-unixodbc[=DIR] for the Unix ODBC library, --with-openlink[=DIR] for OpenLink ODBC support, --with-dbmaker[=DIR] for DBMaker support, --with-adabas[=DIR] for Adabas D support, --with-sapdb[=DIR] for SAP DB support, --with-solid[=DIR] for Solid support, --with-ibm-db2[=DIR] for IBM DB2 support, --with-empress[=DIR] for Empress support, --with-velocis[=DIR] for Velocis support, --with-custom-odbc[=DIR] for custom ODBC-driver support, --with-iodbc[=DIR] for iODBC support, or --with-esoob[=DIR] for Easysoft OOB support.

Oracle

PHP includes two separate Oracle extensions—one for accessing Oracle 7 and earlier databases and one for accessing Oracle 7 and Oracle 8 databases through the Oracle 8 Call-Interface (OCI8). The OCI8 extension is the more full-featured extension and should be used in preference to the older Oracle extension, when possible.

To access Oracle databases with PHP, you must install the appropriate Oracle client libraries and compile PHP with the --with-oci8[=DIR] directive. If you are using Oracle 7 or earlier, compile PHP with the --with-oracle[=DIR] directive instead.

OvrimosSQL

Ovrimos SQL Server is a transactional database combined with web server capabilities. Using this extension, you can access Ovrimos databases.

To enable this extension, you must install the sqlcli library from the Ovrimos SQL Server distribution and compile PHP with the --with-ovrimos[=DIR] option.

pdflib

pdflib provides support for creating PDF documents on the fly. See Chapter 10 for a detailed discussion of creating PDF documents.

To enable this extension, you must install pdflib, the JPEG library, and the TIFF library and compile PHP with the --with-pdflib[=DIR] option. You will also need to specify directories for the zlib library using --with-zlib-dir[=DIR], the JPEG library using --with-jpeg-dir[=DIR], the PNG library using --with-png-dir[=DIR], and the TIFF library using --with-tiff-dir[=DIR].

Verisign Payflow Pro

Verisign Payflow Pro is one of many options available for processing credit cards and performing other financial transactions.

To use this extension, you must install the Verisign Payflow Pro SDK and compile PHP with the --with-pfpro[=DIR] directive.

PostgreSQL

In an earlier incarnation as Postgres, the open source PostgreSQL database pioneered many of the object-relational concepts now appearing in some commercial databases. Because it is fast and provides solid transaction integrity, PostgreSQL is becoming a popular choice as a database for web servers. This extension provides support for accessing PostgreSQL databases.

To use this extension, you must install the PostgreSQL client libraries and compile PHP with the --with-pgsql[=DIR] directive.

pspell

The pspell library interacts with aspell and pspell to check the spelling of words and offer suggestions for misspelled words.

To use it, you must install the pspell and aspell libraries and compile PHP with the --with-pspell[=DIR] directive.

Readline

The GNU Readline library provides functions allowing a program to provide editable command lines; for example, Readline allows you to use the arrow keys to scroll through the command history. As it's an interactive library, its use in PHP web applications is limited (if not nonexistent), but it's available for PHP shell scripts.

To use it, you must install the GNU Readline or libedit libraries and compile PHP with the --with-readline[=DIR] option or, to use libedit, the --with-libedit[=DIR] directive.

Recode

The GNU Recode library converts files between different character sets and encodings. Support for nearly all character sets defined in RFC 1345 is provided.

To use this extension, you must install GNU Recode, Version 3.5 or later, and compile PHP with the --with-recode[=DIR] directive.

Satellite CORBA Client

The Satellite CORBA Client extension allows you to access CORBA objects. CORBA is a method for allowing programs written in a variety of languages to share objects.

To use it, you must install ORBit and compile PHP with the --with-satellite[=DIR] directive.

shmop

This extension provides access to shmop, a set of functions that support Unix-style shared memory segments. This allows you to share chunks of memory with other applications.

To use it, you must compile PHP with the --enable-shmop directive. The shmop library is not available on Windows.

SNMP

SNMP is a protocol used to deliver status information about running servers and processes, including whether a machine is alive, how much memory the machine is currently using, and so on. SNMP can be used to build a systems-monitoring application.

To use it, you must install the UCD SNMP package and compile PHP with the --enable-ucd-snmp-hack[=DIR] directive.

sockets

The sockets extension provides a low-level interface to sockets, providing both server and client functionality.

To use it, you must compile PHP with the --enable-sockets directive.

SWF

Using the libswf library, the SWF extension provides support to PHP scripts for creating Shockwave Flash movies on the fly.

The SWF library is not enabled by default. To use it, you must install libswf and compile PHP with the --with-swf[=DIR] directive.

Sybase

This extension provides support for accessing Sybase database servers.

To use it, you must install the Sybase client libraries and compile PHP with the --with-sybase[=DIR] directive.

System V Semaphore and Shared Memory

These extensions provide System V-style semaphores and shared memory pools. Semaphores allow you to limit the number of processes that can simultaneously use a resource (such as a serial port), possibly even to one process at a time. Shared memory provides a pool of memory that different processes can safely read from and write into, but it does not provide safeguards against simultaneous accesses (that's what the semaphores are for).

To use semaphores and shared memory, you must compile PHP with the --with-sysvsem[=DIR] (for semaphore support) and --with-sysvshm (for shared memory) directives.

vpopmail

The vpopmail extension provides an interface to the vpopmail POP server. It includes functions to manage domains and users.

To use it, you must install vpopmail and compile PHP with the --with-vpopmail directive.

WDDX

These functions are intended for work with WDDX, an XML-based standard for exchanging data between applications. See Chapter 11 for a detailed discussion of using XML in PHP.

The WDDX library is not enabled by default. To use it, you must install the expat library and compile PHP with the --with-xml[=DIR] and --enable-wddx directives.

XML Parser

XML (eXtensible Markup Language) is a data format for creating structured documents. XML can be used to exchange data in a common format, or just as a simple and convenient way of storing document information. This extension provides access to an event-based XML parser. See Chapter 11 for a detailed discussion of using XML in PHP.

To use the XML functions, you must install expat and compile PHP with the --with-xml[=DIR] directive.

XSLT

The eXtensible Stylesheet Language Transformation (XSLT) extension uses the Sablotron library to provide XSLT functionality to PHP scripts. XSLT provides powerful templating features to create HTML and XML documents. See Chapter 11 for an introduction to using XSLT.

To use it, you must install the Sablotron library and compile PHP with the --with-sablot[=DIR] directive.

YAZ

YAZ is a toolkit that implements the Z39.50 protocol for retrieving information from remote servers.

To use it, you must install the YAZ library and compile PHP with the --with-yaz[=DIR] directive.

YP/NIS

NIS (formerly Yellow Pages) allows management and sharing of important administrative files, such as the the password file, across a network.

To use the YP/NIS extension, you must compile PHP with the --enable-yp directive.

ZIP Files

The .zip extension allows PHP scripts to access files compressed in the ZIP format; it does not allow writing the files, just access to the files inside ZIP archives.

To use it, you must install the ZZipLib library and compile PHP with the --with-zip[=DIR] directive.

zlib Compression

This extension uses the zlib library to read and write gzip-compressed files; many of the standard filesystem functions are replicated in this extension and can work with compressed or uncompressed files.

To enable this extension, you must install zlib, Version 1.0.9 or later, and compile PHP with the --with-zlib[=DIR] directive.



Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.