Cannot load module php_mysql.dl!!
| From: | colin_e | Date: | Wed, 17 Nov 2004 10:10:42 +0000 |
| Subject: | Cannot load module php_mysql.dl!! | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-37316@lists.php.net to get a copy of this message | ||
Jonathan, this appears to be an FAQ. LOts of people have the same problem, here's my
commentary from a couple of weeks ago-
Regards: Colin
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
I spent some time experimenting with this to get it working, and came to some interesting conclusions,
which the docs don't always help you with. Here's what I found-
* The libmySQL.dll (note capitalisation) that comes with the mysql install will NOT work with
Apache/PHP, at least with the versions I have. Only the libmysql.dll shipped with the PHP
install works.
I don't know what the reason is, it could be a version mismatch or maybe mysql and PHP are
built using different compilers, but it's a problem.
* I think if the lib shipped with mysql is first in your search path (but see below), it prevents the
PHP-shipped one being seen, and prevents the module loading.
* Some apps install elements in the path using shell variables, i.e.-
PATH Entry Resolves To ------------- ------------ %SystemRoot%\system32 C:\WINDOWS\system32 %ProgramFiles%\PHP C:\Program Files\PHPIt looks like Apache and/or PHP have a problem with this, and fail to load DLLs if their path is specified using a variable. If you list the path directories explicitly, i.e.- C:\WINDOWS\system32;C:\Program Files\PHP it works ok. I can now keep my libmysql.dll file in the PHP install directory, rather than putting a copy in WINDOWS\system32. Nett of all this, is (for me), to get a working system I have: 1) In Apache httpd.conf: # # PHP 5 Support. # LoadModule php5_module "C:/Program Files/PHP/php5apache2.dll" AddType application/x-httpd-php .php 2) System PATH: C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files\MySQL\bin;C:\Program Files\PHP 3) In C:\WINDOWS\php.ini: extension_dir = "C:\Program Files\PHP\ext" extension=php_mysql.dll 4) In C:\Program Files\PHP:
The libmysql.dll supplied with the PHP install.Overall this is more than a bit obscure and error-prone. My initial impression is that Apache 2 is still fairly "green", for instance on my machine after a couple of basic edits of the httpd.conf file I now find the server will crash if I use the Stop or Restart functions of the Apache Service Monitor. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -