MySQL Forums
Forum List  »  PHP

php_mysqli.dll setup error
Posted by: Ashley Sewell
Date: June 21, 2006 09:08PM

Hi,

I've been developing a PHP/mysql application in my development environment using IIS 5.1, mysql 5.0.21 and php 5.1.4. I went throught the mess of getting the "correct" versions of php_mysqli.dll and libmysql.dll from mysql.com as opposed to the ones from php.net (see http://dev.mysql.com/downloads/connector/php/ for details). Plus permissions set to allow the IUSR account to read and execute all the files it needs.

All code works fine in this environment, tested and ready to deploy to our corporate web server, only its a windows 2000 Advanced Server so slightly different environment: IIS 5.0, mysql 5.0.21 and php 5.1.4.

On every PHP page I now get the warning:
"PHP Warning: PHP Startup: Unable to load dynamic library 'c:\php\ext\php_mysqli.dll' - The specified module could not be found. in Unknown on line 0"

Plus each time I try to connect to the mysql database I get this Fatal Error:
"Fatal error: Class 'mysqli' not found in c:\Inetpub\wwwroot\_db.php on line 3"

Line 3 and 4 of this file is:
"$conn = new mysqli("127.0.0.1",$dbUsername,$dbPassword,$dbName,$dbPort) or
die('Could not connect to database');"

Needless to say php_mysqli.dll and libmysql.dll are in exactly the directory they should be...

I have tried:
- copying ALL files related to PHP from the development environment to the production server including php.ini
- Upgrading mysql to 5.0.22 (just in case)
- Upgrading php to 5.2.0 developmental version
- Adding ALL possible paths (\php;\php\ext)
- Double checking permissions allow read/execute access to all necessary files
- Copying all dll's to the "winnt" and "system32" directories
- Replacing ALL existing libmysql.dll files with the newest version
- Ensuring php_mysql.dll is also in the "ext" folder and referenced in php.ini

The closest I came to making it work was by mixing combinations of the php.net and mysql.com versions of libmysql.dll and php_mysqli.dll (this came close that the code ran, but failed when I tried to bind parameters and again when I re-write the prepare statement to embed the parameters in $sql (code below):

$sql = "select id from sometable where p1 = ? and p2 = ?";
if ($rs = $conn->prepare($sql)) {
$rs->bind_param('ss', $param1, $param2);

As you can see I chose to use the Object Orientated implementation of connecting to mysql, please don't tell me I need to re-write as mysqli doesn't work in IIS 5.0!!

This is most frustrating because I have a working application in one environment, but for the life of me I can't get it to work in another that is so very similar!

Someone please help me...

Options: ReplyQuote


Subject
Written By
Posted
php_mysqli.dll setup error
June 21, 2006 09:08PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.