MySQL extension not loading

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

check your error logs.. you may be missing required secondary DLL files..
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post by jayshields »

GM wrote:Have you got the following lines uncommented in your php.ini?

Code: Select all

// MySQLi extension
extension=php_mysqli.dll
I seem to remember reading somewhere that from a certain version of mySQL, you need to use the mysqli.dll extension.
That's incorrect. After a certain version of MySQL the MySQLi extension/functions are needed to take advantage of some new features. It's not required. You can use the MySQL extension/functions with any version of MySQL.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

As of PHP 4.1.3(?) the mysql extension is no longer loaded by default, the mysqli extensions are (in windows). In a default distribution for *nix no extensions are loaded by default (I believe).

On windows machines I have always used Zend studio to install PHP and Apache. MySQL installs quite easily on it's own and requires nothing of PHP in order to work. PHP does require a certain MySQL Client API in order to work with MySQL, depending on the version of the MySQL server, unless you change a few setttings in your my.ini file.
bdlang
Forum Contributor
Posts: 395
Joined: Tue May 16, 2006 8:46 pm
Location: Ventura, CA US

Post by bdlang »

qwasqaws wrote:The only one I have is in the windows directory and phpinfo says that's the one it's reading.
php.ini-dist and php.ini-recommended are in the php folder but they're meant to be there right?
I'd move the c:\windows\php.ini file into your main PHP directory, add your PHP directory to your PATH, restart Apache, see if that has an effect. My XP PHP5 install doesn't have a single file outside the C:\php5 directory.
qwasqaws
Forum Newbie
Posts: 8
Joined: Tue May 30, 2006 5:42 pm

Post by qwasqaws »

This is what I get from the logs:

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

I don't suppose the double backslashes mean anything?

When I tried loading the other sql extensions just to test it gave the same errors for them except it said specified module instead of procedure. I thought that meant it couldn't find the file, though they're in there plain to see.

PHP Warning: PHP Startup: Unable to load dynamic library 'H:\\web\\PHP514\\ext\\php_mssql.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'H:\\web\\PHP514\\ext\\php_msql.dll' - The specified module could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'H:\\web\\PHP514\\ext\\php_mysql.dll' - The specified procedure could not be found.\r\n in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'H:\\web\\PHP514\\ext\\php_sqlite.dll' - The specified module could not be found.\r\n in Unknown on line 0
qwasqaws
Forum Newbie
Posts: 8
Joined: Tue May 30, 2006 5:42 pm

Post by qwasqaws »

I do believe I've solved it. For some reason there was another libmysql.dll in the system32 folder which was only 200kb ish. I replaced it with the one in the mysql folder and now it works! I assume that it was prefering that one instead of the one it was pointed at though I have no idea where that first one came from.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Congrats! And thanks for posting your solution. Some day some poor sap at the end of his rope may stumble upon your post and find your answer.
Post Reply