PHP 5.6.0RC3 is available

Installation des extensions sous Windows

Après avoir installé PHP et un serveur web sous Windows, vous devriez probablement vouloir installer quelques extensions pour avoir des fonctionnalités supplémentaires. Vous pouvez choisir quelles extensions seront chargées lors du démarrage de PHP en modifiant votre php.ini. Vous pouvez également en charger dynamiquement dans vos scripts à l'aide de la fonction dl().

Les bibliothèques DLLs pour les extensions PHP sont préfixées par php_.

Beaucoup d'extensions sont incluses dans la version pour Windows de PHP. Cela signifie que les bibliothèques DLL additionnelles et la directive extension ne sont pas utilisées pour charger ces extensions. La table des extensions PHP pour Windows liste les extensions qui requièrent des bibliothèques DLL additionnelles PHP. Voici une liste d'extensions internes :

En PHP 4 (mise à jour : PHP 4.3.11) : BCMath, Caledar, COM, Ctype, FTP, MySQL, ODBC, Overload, PCRE, Session, Tokenizer, WDDX, XML et Zlib

En PHP 5 (mise à jour : PHP 5.0.4), les changements suivants existent. En interne : DOM, LibXML, Iconv, SimpleXML, SPL et SQLite. Les suivants ne sont plus intégrés : MySQL and Overload.

Le dossier par défaut dans lequel PHP cherche des extensions est c:\php4\extensions en PHP 4 et c:\php5 en PHP 5. Pour changer ce comportement pour refléter votre installation de PHP, éditez votre fichier php.ini :

  • Vous devriez pouvoir changer le paramètre extension_dir pour pointer vers le dossier contenant vos extensions ou l'endroit où vous avez placé vos fichiers php_*.dll. Par exemple :

    extension_dir = c:\php\extensions

  • Pour activer ces extensions dans votre php.ini, vous devez décommenter les lignes extension=php_*.dll dans votre php.ini. Cela se fait en effaçant le point virgule (";") du début de la ligne que vous voulez activer.

    Exemple #1 Activer l'extension Bzip2 pour PHP-Windows

    // changez la ligne suivante :
    ;extension=php_bz2.dll
    
    // En :
    extension=php_bz2.dll

  • Quelques extensions ont besoin de bibliothèques DLLs supplémentaires pour fonctionner. La plupart d'entre elles peuvent être trouvées dans le paquet de votre distribution de PHP, dans le dossier c:\php\dlls\ en PHP 4 ou dans le dossier principal en PHP 5 mais quelques autres, comme Oracle (php_oci8.dll), requierent des DLLs qui ne sont pas fournies avec votre distribution de PHP. Si vous installez PHP 4, copiez les bibliothèques DLLs depuis le dossier C:\php\dlls vers le dossier principal C:\php. N'oubliez pas d'inclure le dossier C:\php dans la variable d'environnement PATH (ce processus est expliqué dans une entrée de la FAQ).

  • Quelques-unes de ces bibliothèques ne sont pas incluses dans la distribution de PHP. Lisez la documentation de chaque extension pour plus de détails. Lisez également la section du manuel nommée Installation d'extensions PECL pour plus de détails sur PECL. Un nombre toujours plus important d'extensions PHP se trouve dans PECL, et ces extensions nécessitent un téléchargement séparé.

Note: Si vous utilisez PHP en tant que module d'un serveur web, pensez à redémarrer votre serveur web pour charger les modifications apportées au fichier php.ini.

La table suivante décrit quelques extensions disponibles requérant des bibliothèques DLLs supplémentaires.

Extensions PHP
Extension Description Notes
php_bz2.dll bzip2 : fonctions de compression Non
php_calendar.dll Calendar : fonctions de conversion Intégrées à PHP depuis la version 4.0.3
php_crack.dll Fonctions Crack None
php_ctype.dll Famille de fonctions ctype Intégrées à PHP depuis la version 4.3.0
php_curl.dll Fonctions de bibliothèque client CURL Requiert : libeay32.dll, ssleay32.dll (intégré)
php_dba.dll DBA: DataBase (dbm-style) Fonctions d'abstraction Non
php_dbase.dll Fonctions dBase Non
php_dbx.dll Fonctions dbx  
php_domxml.dll Fonctions DOM XML PHP <= 4.2.0 requiert : libxml2.dll (intégré) PHP >= 4.3.0 requiert : iconv.dll (intégré)
php_dotnet.dll Fonctions .NET PHP <= 4.1.1
php_exif.dll Fonctions EXIF php_mbstring.dll. Attention, php_exif.dll doit être chargé après php_mbstring.dll dans le php.ini.
php_fbsql.dll Fonctions FrontBase PHP <= 4.2.0
php_fdf.dll FDF : fonctions Forms Data Format. Requiert : fdftk.dll (intégré)
php_filepro.dll Fonctions filePro Accès en lecture seule
php_ftp.dll Fonctions FTP Intégrées à PHP depuis la version 4.0.3
php_gd.dll GD : bibliothèque de fonctions image Supprimer en PHP 4.3.2. Notez que les fonctions sur les couleurs vraies ne sont pas disponibles en GD1 ; utilisez plutôt php_gd2.dll.
php_gd2.dll GD : Bibliothèque de fonctions image GD2
php_gettext.dll Fonctions Gettext PHP <= 4.2.0 requiert gnu_gettext.dll (intégré), PHP >= 4.2.3 requiert libintl-1.dll, iconv.dll (intégré).
php_hyperwave.dll Fonctions HyperWave Non
php_iconv.dll ICONV : conversion de jeux de caractères Requiert : iconv-1.3.dll (intégré), PHP >=4.2.1 iconv.dll
php_ifx.dll Fonctions Informix Requiert : bibliothèque Informix
php_iisfunc.dll Fonctions d'administration IIS Non
php_imap.dll IMAP : fonctions POP3 et NNTP Non
php_ingres.dll Fonctions Ingres Requiert : bibliothèque Ingres
php_interbase.dll Fonctions InterBase Requiert : gds32.dll (intégré)
php_java.dll Fonctions Java PHP <= 4.0.6 requit : jvm.dll (intégré)
php_ldap.dll Fonctions LDAP PHP <= 4.2.0 requiert libsasl.dll (intégré), PHP >= 4.3.0 requiert libeay32.dll, ssleay32.dll (intégré)
php_mbstring.dll Fonctions Chaînes multioctets Non
php_mcrypt.dll Fonctions Mcrypt Encryption Requiert : libmcrypt.dll
php_mhash.dll Fonctions Mhash PHP >= 4.3.0 requiert : libmhash.dll (intégré)
php_mime_magic.dll Fonctions Mimetype Requiert : magic.mime (intégré)
php_ming.dll Fonctions Ming pour Flash Non
php_msql.dll Fonctions mSQL Requiert : msql.dll (intégré)
php_mssql.dll Fonctions MSSQL Requiert : ntwdblib.dll (intégré)
php_mysql.dll Fonctions MySQL PHP >= 5.0.0, requires libmysql.dll (intégré)
php_mysqli.dll Fonctions MySQLi PHP >= 5.0.0, requires libmysql.dll (libmysqli.dll en PHP <=5.0.2) (intégré)
php_oci8.dll Fonctions Oracle 8 Requiert : bibliothèque cliente Oracle 8.1+
php_openssl.dll Fonctions OpenSSL Requiert : libeay32.dll (intégré)
php_overload.dll Fonctions Object overloading Intégrée à PHP depuis la version 4.3.0, supprimé de PHP en version 5.0.0.
php_pdf.dll Fonctions PDF Non
php_pgsql.dll Fonctions PostgreSQL Non
php_shmop.dll Fonctions de partage de mémoire Non
php_snmp.dll Fonctions SNMP NT seulement !
php_soap.dll Fonctions SOAP PHP >= 5.0.0
php_sockets.dll Fonctions Socket Non
php_sybase_ct.dll Fonctions Sybase Requiert : bibliothèque cliente Sybase
php_tidy.dll Fonctions Tidy PHP >= 5.0.0
php_tokenizer.dll Fonctions Tokenizer Intégrées à PHP depuis la version 4.3.0
php_w32api.dll Fonctions W32api Non
php_xmlrpc.dll Fonctions XML-RPC PHP >= 4.2.1 requiert : iconv.dll (intégré)
php_xslt.dll Fonctions XSLT PHP <= 4.2.0 requiert sablot.dll, expat.dll (intégré). PHP >= 4.2.1 requiert sablot.dll, expat.dll et iconv.dll (intégré).
php_yaz.dll Fonctions YAZ Requiert : yaz.dll (intégré)
php_zip.dll Fonctions Zip File Accès en lecture seule
php_zlib.dll Fonctions de compression ZLib Intégrées à PHP depuis la version 4.3.0

add a note add a note

User Contributed Notes 12 notes

up
2
JB
5 years ago
I had a problem with the gd and mysqli mods on my PHP5.2/Apache2.2/Windows 2003 server. Even after enabling the options in the php.ini file and restarting the Apache service, the mods still would not load. I even tried to restart the Windows 2003 server that php is loaded on - and no go. After reviewing the system path variables in Windows, I noticed that the c:\php directory was set in the path variable, but not the folder for the gd, mysqli and others mods. So I added c:\php\ext to the path variable and rebooted the server. THAT FIXED IT!!
up
2
smaines at alaya dot com
6 years ago
== Problem

Consider the following from an httpd.conf file...

  LoadModule php5_module "E:/xyz/php/php5apache2_2.dll"
  PHPIniDir "E:/xyz/php"

...which led to the dreaded...

  PHP Warning:  PHP Startup: Unable to load dynamic library 'E:\\xyz\\php\\ext\\php_mysql.dll' - The specified module could not be found.

Note, however, that PHP.exe apparently was found and executed php pages in Apache, but the MySQL functions therein failed.

== Solution

Because PHP dir was not in $PATH, php5apache2_2.dll failed to find php_mysql.dll (the only extension I enabled) during Apache 2.2 start.

== Caveat (!)

The BIG issue is that, setting $PATH in...

  <desk icon>My Computer
  <rt click>Properties
  <tab>Advanced
  <button>Environment Variables

...didn't export the $PATH change such that restarting the Apache service (in MMC) would pick it up.  So I tested the working solution (adding PHP dir to $PATH), but it failed because of HOW I set it. It succeeded only when I REBOOTED after changing the $PATH.  There may be an easier way that this, but I do not know it at present.

== Comment

Consider whether PHP dir should need to be in $PATH at all, when PHP.exe apparently was found and executes php pages in Apache, but php5apache2_2.dll failed to find whatever was needed to load the extensions.  This should perhaps be addressed.

Note that on a WAMP installation (W2K,Apache,MySQL,PHP), only PHP is required in $PATH.
up
2
simi_def at c2 dot hu
7 years ago
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.
up
1
amainATgoldcoastdesignORG
5 years ago
I just recently tried to upgrade my php install on WinXP using the php-5.2.6-win32-installer.msi and with fingers crossed, tried to see if things still worked or not.

Unfortunately, they didn't.  I did see many posts here and elsewhere on the web regarding the error message:

"Unable to load dynamic link library 'ext\php_xxxxx.dll' - The specified module could not be found."

php.net says in the past when upgrading to simply copy over new php files, but now recommends using the windows installer.  Maybe the installer isn't quite up to the task yet.

My fix:

1. Completely uninstall current version of php (using Windows Control Panel > Add or Remove Programs).

2. Download the current php binaries for Windows (at php.net/downloads.php under Windows Binaries).  Should be format: PHP 5.x.x zip package.  Again, download the binaries, NOT the installer.

3. Follow these easy steps
http://www.ricocheting.com/server/php.html

4. Set your PATH for Windows to find php (if you haven't already):
a. Right-click on My Computer
b. Properties
c. Advanced Tab > Environment Variables
d. Under System variables, scroll down to find "Path", select and click on Edit
e. Add path to your php install on the end (make sure to precede with semi-colon ";").  Mine was ";G:\Apache\php"
f. Click Okay.  (then "Okay" on each of the other open windows).

5. Test php install. (see ricocheting link above for testing).

6. Getting the extensions to work again:
a. Open php.ini
b. uncomment each extension, restart Apache.

7. Special note on libmysql.dll and problems getting MySQL to work:
- You may have copied over this file into your Windows/System32 (or WINNT/System32 for me) to get mysql to work in the past.  If so, replace it with the most recent version you get with the upgrade (in top dir).
- If this is a fresh install, copy the libmysql.dll into your System32 folder.

Couple notes:
1. The above tutorial link is to install php 5.x on Apache 2.2 for Win.  If you're running Apache 2.0 like me, pay special attention to "Editing Apache Conf File" for correct LoadModule info.
2. If you ran the installer previously, double check your Apache conf where the php5 LoadModule stuff is.  The installer might have messed with this a bit.

I hope this stuff helps.
-Art
up
1
JerryG
6 years ago
Installing PHP extensions for IIS for the first time is sort of a baptism by fire -- you will get your hands dirty, and other suitable metaphors of nastiness.  Hopefully, you won't have to spend too many days googling around fora and restarting IIS 10 million times as I did until I finally realized both what was going on and what crazy things I'd done wrong.

THIS (peter)guy really goes into terrific detail and troubleshooting, (with very good reasons and explanations of extension dependencies not listed on the current php page you're now reading):

http://www.peterguy.com/php/install_IIS6.html

Most of this is applicable for IIS5.1 as well, as far as I've found.

The main problem I'd been butting my head up against was extensions being reported as not found, even though the .DLLs were definitely in C:\PHP\ext, and my PATH env var was setup correctly. 

The error messaging during dynamic loading of implicitly-linked libraries should be more specific, telling you that in fact it is a particular dependency of a dependency which is missing -- usually some obscure third-party .dll -- and name it!

Eventually I stopped being so greedy and just cut down on the extensions I thought I needed by commenting them out in php.ini.  That eliminated the startup errors.  Apparently some of these extensions or their requirements, which either come with the base PHP install zip or the PECL extensions, are either too obscure or too fragile to be necessary anyway.

Good luck, and I hope anyone who runs into the same trouble can hit upon this or Peter Guy's page directly before they go too crazy.
up
1
Anonymous
4 years ago
I had problem with extensions - they don't loaded (without errors) on Windows installation and don't displayed in phpinfo().

Solve: full-specified directory name for extension_dir directive - "c:/php/ext/" instead "./"
up
1
Anonymous
8 days ago
Hello,

Where is the php_pspell.dll for Windows? Where we can download it from? I don't have it in my PHP package (ver. 5.3.8).

Cheers!
up
1
mech
6 months ago
If you have problems, that windows-extensions can not be loaded (PHP Warning: PHP Startup: Unable to load dynamic library) and you are sure, the .ddl is in the right place, use ProcessMonitor (http://technet.microsoft.com/de-de/sysinternals/bb896645.aspx)

here you can see at startup, which files php tries to find and in which locations php tries to find them!
up
0
jma59 at cam dot ac dot uk
6 years ago
Under windows, given an error similar to

PHP Warning:  PHP Startup: Unable to load dynamic library 'c:\\php\\ext\\php_mysql.dll' - The specified module could not be found.\r\n in Unknown on line 0

When PHP definitely should be able to find the module, it's fairly common knowledge that this error can also be caused by  certain dlls not being in the PATH. These dlls (usually libeay32 and ssleay32) are generally found in your base php directory, and the modern windows installers add the base php directory to the PATH so that you don't need to worry about it. However, if when installing earlier versions you decided on moving libeay32, ssleay32 et al to C:\Windows\System32 instead of changing the PATH, then php will still end up with the old versions and the out of date versions will cause the same error as above. Don't fall into the trap like I did.
up
-1
Manda Krishna Srikanth
6 years ago
As far as my experience says, 95% of ext\php_mysql.dll - The specified module could not be found - error can be sorted out on Win 2003, IIS 6, PHP5.2.

Replace the php_mysql.dll and libmysql.dll downloaded from http://dev.mysql.com/downloads/connector/php/ into extensions directory.

For MSSQL connectivity problems, replace the ntwdblib.dll in php dir with the one copied from system32 directory. Ofcourse the filesize will be less, no problem, replace it.
up
-1
rafaurl at gmail dot com
3 years ago
I got the following error:

PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\PHP\ext\php_curl.dll'

By using sysinternals procmon I saw that it failed after trying to load "zlib.dll". I found this file deployed with other software (in my case, Miranda IM) and copied it to the PHP installation directory. It worked fine after that. Hope that helps.
up
-1
vatozana at yahoo dot com
3 years ago
I had problems registering Curl extentions and it was cause by the old dll of libeay32.dll and  ssleay32.dll  which were already in my c:\windows\system32 I replaced them and all is now fine!!
To Top