Question

J'ai ajouté php comme module pour Apache 2.2.11:

LoadModule php5_module "c:/php/php5apache2_2.dll"

Et aussi ajouté

AddType application/x-httpd-php .php

Et dans le php.ini, mon extension dir est réglé sur: extension_dir = "C:\php\ext"

oui , les répertoires sont corrects et tous les fichiers existent.

Mais quand je commence apache, je reçois ces erreurs:

  

PHP Warning: PHP Startup: Impossible de charger 'C: \ php \ ext \ php_mysql.dll' bibliothèque dynamique -. Le module spécifié est introuvable \ r \ n in Unknown on line 0
  PHP Warning: PHP Startup: Impossible de charger 'C: \ php \ ext \ php_pdo_pgsql.dll' bibliothèque dynamique -. Le module spécifié est introuvable \ r \ n in Unknown on line 0
  PHP Warning: PHP Startup: Impossible de charger 'C: \ php \ ext \ php_pgsql.dll' bibliothèque dynamique -. Le module spécifié est introuvable \ r \ n in Unknown on line 0
  [Sun 17 mai 2009 03:46:01] [Avis] Apache / 2.2.11 (Win32) PHP / 5.2.9-2 Configuré - la reprise des opérations normales
  [Dim 17 mai 2009 03:46:01] [Avis] Serveur construit: 10 décembre 2008 00:10:06
  [Dim 17 mai 2009 03:46:01] [Avis] Parent: processus enfant créé 4652
  PHP Warning: PHP Startup: Impossible de charger 'C: \ php \ ext \ php_mysql.dll' bibliothèque dynamique -. Le module spécifié est introuvable \ r \ n in Unknown on line 0
  PHP Warning: PHP Startup: Impossible de charger 'C: \ php \ ext \ php_pdo_pgsql.dll' bibliothèque dynamique -. Le module spécifié est introuvable \ r \ n in Unknown on line 0
  PHP Warning: PHP Startup: Impossible de charger 'C: \ php \ ext \ php_pgsql.dll' bibliothèque dynamique -. Le module spécifié est introuvable \ r \ n in Unknown on line 0
  [Dim 17 mai 2009 03:46:01] [Avis] enfant 4652: processus enfant est en cours d'exécution
  [Dim 17 mai 2009 03:46:01] [Avis] enfant 4652:. Acquis le mutex de démarrage
  [Sun 17 mai 2009 03:46:01] [Avis] enfant 4652:. À partir de 64 threads de travail
  [Dim 17 mai 2009 03:46:01] [Avis] enfant 4652: fil à partir d'écouter sur le port 80.

Alors j'oublie sans doute quelque chose de simple ici, quelqu'un peut me dire ce que j'oublie?

Était-ce utile?

La solution

Non seulement vous avez besoin de DLL de PHP extension afin d'ajouter le support MySQL et PostgreSQL à PHP. Vous devez également MySQL et PostgreSQL bibliothèques natives. Les DLL de PHP extension ne sont probablement pas trouver quelques DLL dont ils dépendent, ils ne peuvent pas commencer.

Assurez-vous d'avoir un client MySQL et PostgreSQL installé et leurs DLL dans un endroit localisables.

i.e.. exemple:

  • php_mysql.dll dépend libmysql.dll

Alors, assurez-vous que PHP est capable de trouver libmysql.dll (je crois que celui-ci est livré avec la distribution binaire de Windows PHP. Je ne sais pas si).

Autres conseils

Pour ajouter à l'avis de Pablo Santa Cruz. Sur les fenêtres, vous pouvez inclure les bibliothèques nécessaires dans l'environnement PATH. (Pas nécessairement copier dans le dossier Windows). Lorsque chargement des bibliothèques veuves regarde dans les répertoires ainsi C:\php.

Si vous utilisez la distribution binaire standard Win32 de php.net pour PHP5.2, le paquet doit contenir toutes les dépendances à la racine des paquets. Donc, si vous avez installé le PHP5.2 dans <=>, ajoutez ce répertoire à la envar <=>. Redémarrez Apache et je pense extensions charger correctement.

J'ai eu un problème avec une version spécifique de PHP sur Windows. Le problème était libmysql. J'ai trouvé un bug affiché sur le site php.net de quelqu'un ayant le même problème.

J'ai utilisé la version précédente php et libmysql travaillé. Consultez les notes sur la distribution de php que vous utilisez. Je pense que, après une version spécifique, ils mentionnent une nouvelle politique concernant libmysql.

D'après ce que vous mentionnez php ne parvient pas à trouver les extensions. Assurez-vous que vous avez défini le chemin sur php.ini qui spécifie où les extensions sont situées, que les extensions existent et que le dossier peut accéder (en lecture permissions).

Si tout cela échoue essayez de déplacer l'extension aux fenêtres / system32 dans un effort pour trouver ce qui pourrait être le vrai problème.

Cordialement,

Those extensions depend on native libraries which are provided by the MySQL and PostgreSQL binary distributions. Install them and put the libs in apache's bin folder for example. Those are LIBMYSQL.DLL and LIBPQ.DLL respectively.

I usually do that instead of polluting Windows/System32 folder with them, because on my system only the apache/php is the client of those databases and also it makes my apache/php setup more portable.

In my experience, PHP on Windows is a major pain in the behind. I usually get it to work eventually, but there's always a lot of googling and trial-and-error involved - for me at least.

So I finally got sick and tired of it and simply installed Ubuntu Server in a VM and had it up and running within minutes. Whether this is an option for you or not I can't say, but if it is it will most definitely save you a lot of headaches in the long run. Not to mention you can always move your VMs around, create snapshots and do all the other fancy stuff that VMs are good for.

I had the same problem. I was getting one of those annoying windows popup errors everytime I tried to log in to phpmyadmin. I typed in the username and password and then would throw the error.

What solved it for me, was also copying the libmysql.dl to the apache bin directory. The strange thing is apparantly the extensions where included correctly but still I needed to do this.

I tried several of these solutions and one or more of them worked... Rebooting is the key here. I did not reboot in between these changes, but after I rebooted it was working:

  • add postgres DLL to apache lib dir
  • add postgres path to system PATH
  • add postgres DLL to system32

I believe just the PATH would have worked but no time for cleanliness here so there you go.

the problem here is that apache has loaded PHP, but PHP was not able to load its extension (mysql, postgresql, ...). I think you should enter path values in your php.ini file in unix format (do not use backslash characters as directory separator). so in your php.ini file change this:

extension_dir="C:/php/ext"

I'm also had same problem and solved by adding "PostgreSQL" bin path into System Environment variables

PATH: C:\Program Files\PostgreSQL\8.4\bin You can check in phpinfo() also.

When I install PostgreSQL, setting into System Path missed. I manually added then restart the system.

I had this problem too, and copied the pertinent (.dlls) to systen 32 and it still did not work for me. I am running Windows 7 64bit. To get this to work for me I had to also copy the libmysql.dll to the ext directory. The error message left the Apache log and the page loaded with a favorable response (conection established).

I had the same problem and have tried copying libmySQL.dll to the apache bin folder and it solved the problem (I'm setting up PHP 5.2.5 x64). Many thanks.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top