PHP: Installation of extensions on Windows - Manual

downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Installation of PECL extensions Building from source

Last updated: Fri, 26 Jan 2007

view this page in

# Installation of extensions on Windows

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:

In PHP 4 (updated PHP 4.3.11): BCMath, Caledar, COM, Ctype, FTP, MySQL, ODBC, Overload, PCRE, Session, Tokenizer, WDDX, XML и Zlib

In PHP 5 (updated PHP 5.0.4), the following changes exist. Built in: DOM, LibXML, Iconv, SimpleXML, SPL и SQLite. And the following are no longer built in: MySQL and Overload.

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.

  Пример 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.

> Замечание: 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.

Таблица 6-1. PHP Extensions

Extension | Description | Notes
--- | --- | ---
php_bz2.dll | bzip2 compression functions | None
php_calendar.dll | Calendar conversion functions | Built in since PHP 4.0.3
php_cpdf.dll | ClibPDF functions | None
php_crack.dll | Crack functions | None
php_ctype.dll | ctype family functions | Built in since PHP 4.3.0
php_curl.dll | CURL, Client URL library functions | Requires: `libeay32.dll`, `ssleay32.dll` (bundled)
php_cybercash.dll | Cybercash payment functions | PHP <= 4.2.0
php_db.dll | DBM functions | Deprecated. Use DBA instead (`php_dba.dll`)
php_dba.dll | DBA: DataBase (dbm-style) Abstraction layer functions | None
php_dbase.dll | dBase functions | None
php_dbx.dll | dbx functions |
php_domxml.dll | DOM XML functions | PHP <= 4.2.0 requires: `libxml2.dll` (bundled) PHP >= 4.3.0 requires: `iconv.dll` (bundled)
php_dotnet.dll | .NET functions | PHP <= 4.1.1
php_exif.dll | EXIF functions | php_mbstring.dll. And, `php_exif.dll` must be loaded `after` `php_mbstring.dll` in `php.ini`.
php_fbsql.dll | FrontBase functions | PHP <= 4.2.0
php_fdf.dll | FDF: Forms Data Format functions. | Requires: `fdftk.dll` (bundled)
php_filepro.dll | filePro functions | Read-only access
php_ftp.dll | FTP functions | Built-in since PHP 4.0.3
php_gd.dll | GD library image functions | Removed in PHP 4.3.2. Also note that truecolor functions are not available in GD1, instead, use `php_gd2.dll`.
php_gd2.dll | GD library image functions | GD2
php_gettext.dll | Gettext functions | PHP <= 4.2.0 requires `gnu_gettext.dll` (bundled), PHP >= 4.2.3 requires `libintl-1.dll`, `iconv.dll` (bundled).
php_hyperwave.dll | HyperWave functions | None
php_iconv.dll | ICONV characterset conversion | Requires: `iconv-1.3.dll` (bundled), PHP >=4.2.1 `iconv.dll`
php_ifx.dll | Informix functions | Requires: Informix libraries
php_iisfunc.dll | IIS management functions | None
php_imap.dll | IMAP POP3 and NNTP functions | None
php_ingres.dll | Ingres II functions | Requires: Ingres II libraries
php_interbase.dll | InterBase functions | Requires: `gds32.dll` (bundled)
php_java.dll | Java functions | PHP <= 4.0.6 requires: `jvm.dll` (bundled)
php_ldap.dll | LDAP functions | PHP <= 4.2.0 requires `libsasl.dll` (bundled), PHP >= 4.3.0 requires `libeay32.dll`, `ssleay32.dll` (bundled)
php_mbstring.dll | Multi-Byte String functions | None
php_mcrypt.dll | Mcrypt Encryption functions | Requires: `libmcrypt.dll`
php_mhash.dll | Mhash functions | PHP >= 4.3.0 requires: `libmhash.dll` (bundled)
php_mime_magic.dll | Mimetype functions | Requires: `magic.mime` (bundled)
php_ming.dll | Ming functions for Flash | None
php_msql.dll | mSQL functions | Requires: `msql.dll` (bundled)
php_mssql.dll | MSSQL functions | Requires: `ntwdblib.dll` (bundled)
php_mysql.dll | MySQL functions | PHP >= 5.0.0, requires `libmysql.dll` (bundled)
php_mysqli.dll | MySQLi functions | PHP >= 5.0.0, requires `libmysql.dll` (`libmysqli.dll` in PHP <= 5.0.2) (bundled)
php_oci8.dll | Oracle 8 functions | Requires: Oracle 8.1+ client libraries
php_openssl.dll | OpenSSL functions | Requires: `libeay32.dll` (bundled)
php_oracle.dll | Oracle functions | Requires: Oracle 7 client libraries
php_overload.dll | Object overloading functions | Built in since PHP 4.3.0
php_pdf.dll | PDF functions | None
php_pgsql.dll | PostgreSQL functions | None
php_printer.dll | Printer functions | None
php_shmop.dll | Shared Memory functions | None
php_snmp.dll | SNMP get and walk functions | NT only!
php_soap.dll | SOAP functions | PHP >= 5.0.0
php_sockets.dll | Socket functions | None
php_sybase_ct.dll | Sybase functions | Requires: Sybase client libraries
php_tidy.dll | Tidy functions | PHP >= 5.0.0
php_tokenizer.dll | Tokenizer functions | Built in since PHP 4.3.0
php_w32api.dll | W32api functions | None
php_xmlrpc.dll | XML-RPC functions | PHP >= 4.2.1 requires: `iconv.dll` (bundled)
php_xslt.dll | XSLT functions | PHP <= 4.2.0 requires `sablot.dll`, `expat.dll` (bundled). PHP >= 4.2.1 requires `sablot.dll`, `expat.dll`, `iconv.dll` (bundled).
php_yaz.dll | YAZ functions | Requires: `yaz.dll` (bundled)
php_zip.dll | Zip File functions | Read only access
php_zlib.dll | ZLib compression functions | Built in since PHP 4.3.0

add a note User Contributed Notes
Installation of extensions on Windows
glenn65535 AT yahoo DOT com
13-Feb-2007 12:51
`When confronted with the problem "PHP Warning: PHP Startup: Unable to load dynamic library './php_mysql.dll' - Access is denied.\r\n in Unknown on line 0" I found I had to make the permissions "chmod.exe 755 php_mysql.dll"
(This is on a Windows XP, but I am running Cygwin).`
YYE (yeyuancn2 at yahoo dot com)
15-Nov-2006 01:10
`I just installed PHP5.2 + Apache2.2 + MySQL5 on Windows XP. Three imporatant things.
1. I tryed to put php.ini in windows directory like in early version. But php can't load it and using default values only. After I put php.ini into php installation directory, everything is fine.
2. You still need to copy libmysql.dll to windows\system32 directory for the mysql extension to work.
3. Don't forget for apache 2.2, you need php5apache2_2.dll instead of php5apache2.dll.`
Freddo
12-Oct-2006 06:11
`We tried to install PHP 4 ISAPI Module on IIS 6 on a Windows Server 2003 SP2 at the office.
The only way we found out to make these extensions work, is by putting the extensions DLLs in the System32\inetsrv in the Windows directory. We did the same previously with the
php4isapi.dll and php4ts.dll to make PHP work. The system was asking for a password previously.
We cannot explain it, it seems like a problem only occuring with SP2 installed because we never had this problem before. Giving the right permission to the PHP and extensions folders didn't do anything good. It always gave use a permission denied error. We even tried to give full control to Everyone on the PHP folder, same result.
I hope it can help.`
elsint at yahoo dot com
26-Sep-2006 11:38
`Installing PHP5.1.6 on an IIS5.1 system.
Some extensions are not working because of registry(like LDAP).
You need to create a registry file named: "inifilepath.reg"
Content should be the 3 lines under,be sure to define your PHP path correct:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\PHP]
"IniFilePath"="C:\\PHP"
After creating this file, double click it, click yes, and restart IIS. Hopefully this might solve problem for some, as it solved for me.`
simi_def at c2 dot hu
17-Aug-2006 01:10
`I had problems with PHP5/Apache2.2/MySQL 5 installation on a WinXp machine.
I got the
Fatal error: call to undefined function - mysql_connect().
message
Solution :
1, use correct version of ext\php_mysql.dll and libmysql.dll
2, !!! edit the CORRECT php.ini (%windir%\php.ini) like c:\windows\php.ini !!!
3, add php installation dir to PATH
4, edit php.ini to load extension php_mysql.dll
use
<?php
phpinfo();
?>
to check.`
hevesir at t-mobile dot hu
07-Apr-2006 01:54
`If You try to install PHP5 to IIS6 with Oracle....
Then You need some kind of pilot-exams, not for big planes, just a little one.
So: After installations (php.ini is correct see above ie.: extenstion = php_oci8.dll etc)
If You use anonymous access, You'll have a builtin user to use it. Make this user local administrator, or give minimum read access to PHP folder (ie.: c:\php) and ORAHOME (ie. c:\ora92) folders.
If You use Windows Integrated authentication, give for Domain Users minimum read access to PHP folder (ie.: c:\php) and ORAHOME (ie. c:\ora92) folders.
Goog luck.`
sopp_ladios at hotmail dot com
19-Aug-2004 09:35
`[editor note: this should be fixed in PHP 5.1.0]
The order of the extensions listed in php.ini is causing problems... one must check that a particular extension A is enabled and above extension B if B requires A to be enabled.
The original ordering doesnt make sure that this always happens (ie, A is above B)
I came into this problem when I tried to enable the exif extension under windows. I knew mbstring is required but I kept getting errors even after I enabled both.
The problem can only be fixed by moving the mbstring line above the exif line...`
add a note
Installation of PECL extensions Building from source

Last updated: Fri, 26 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 09:32:46 2007 PST