Hello,
I am installed php 5.3.28 with apache 2.2 and mysql 5.5.38 on windows 64 bit machine, despite configuring php correctly with apache and also enabled the extensions, its not able to recognise the mysql extension loaded.
The connection attempt through adodb throws the error "call to undefined function mysql_connect() in adodb\drivers\adodb-mysql.inc.php on line 460".
Also the function_exists('mysql_connect') return false;

I would appreciate your quick suggestions.

thank you.

Dani AI

Generated

A short, practical checklist for the "undefined function mysql_connect()" scenario that appears when PHP's MySQL extension is not available to the server process. This usually means the PHP instance Apache runs is not loading the extension DLLs (or a different php.ini / PHP build is being used). ' suggestion to check the extension path was on the right track, and 's follow-up shows the problem is often the webserver using a different configuration than the one edited.

Create a minimal phpinfo page to confirm what Apache is actually loading:

<?php
phpinfo();
?>

Key things to check in that output: the "Loaded Configuration File" (which php.ini is active), the "extension_dir" value, the PHP build/Compiler and Architecture, and any Startup messages. From there: 1) verify the named extension directory contains the mysql-related DLLs; 2) confirm the corresponding extension= lines in the active php.ini are enabled; 3) restart Apache after changes and watch Apache/PHP error_log for “Unable to load dynamic library” messages; 4) use where php and php -v on the server/CLI to detect multiple PHP installs.

Other common pitfalls: running a Thread-Safe vs Non-Thread-Safe PHP build that does not match the Apache module, missing Visual C++ Redistributable required by that PHP build, or accidentally editing the CLI php.ini instead of the one Apache uses. Fixes usually involve pointing Apache to the intended php.ini (or installing the matching VC runtime), ensuring the correct DLLs exist in extension_dir, and restarting Apache.

Longer-term: migrate away from the old mysql extension — it was deprecated and later removed — and use mysqli or PDO (or set ADOdb to use the mysqli/pdo drivers). This prevents future breakage when upgrading PHP.

Recommended Answers

All 3 Replies

Have you checked your extension_dir setting in the config file? It may be making PHP look in the worng location for extension modules.
Otherwise, I got nothing...

thank you for your response, but I checked extension dir already. In the php.ini have mentioned it as -
extension_dir=ext (also tried it making a full path as 'c:\php\ext' without any difference)
But the phpinfo() lists the extension_dir path as only 'c:\php'

never mind,I could solve it. The problem was apache was not able to get the right copy of php.ini. So has to provide the php.ini in it's apache/bin folder and it works as expected now.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.