php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38070 libmysql.dll and/or php_mysql.dll
Submitted: 2006-07-11 18:45 UTC Modified: 2006-07-12 02:04 UTC
From: rodney at nerdsindenial dot com Assigned:
Status: Not a bug Package: MySQL related
PHP Version: 5.1.4 OS: Windows XP Pro/sp2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: rodney at nerdsindenial dot com
New email:
PHP Version: OS:

 

 [2006-07-11 18:45 UTC] rodney at nerdsindenial dot com
Description:
------------
 I have the same problem and have tried most of the proposed solution
(change PHPRC, eliminate all of the php.ini files but one; move php_mysql.dll and/or libmysql.dll to php/ext and php). I can create and populate a database
in MySQL v5.1; install and run PHP5.2 (this is from the daily build directory to pick up the fixes php5_apache2.dll -> php_apache2_2.dll to solve dependency issues with missing dll for LoadModule php5_module modules/php_apache2.dll (broken, need new name) in "X":\php\php.ini) I found this solution and directory in the www.php.net FAQ's. I was able to run PHP scripts from a mozilla FireFox client on the Apache server in the .\Apache2.2\httdocs directory including phpinfo(). The Apache v2.2.2 server installed and ran without a hitch. HOWEVER, I COULD NOT link to mysql_connect() or any other mysql function within a PHP script. I finally changed display_startup_errors in the php.ini file from off-to-on and restarted
the Apache 2.2.2 server. It displayed the following in a warning dialog box:

PHP Startup: Unable to initialize module
Module compiled with module API=20050613, debug=0, thread-safety=1
PHP compiled with module API=20050922, debug=0, thread-safety=1
These options need to match

OK

I am not able to compile the source for libmysql.dll or php_mysql.d.. (PECL).
It looks like a recompile of the mysql "shared" libraries may solve either all
or part of the problem. I hope the developers at www.php.net are listening??

Irie
Rodney

Reproduce code:
---------------
	<?PHP
		$dbUser = "root";
		$dbPass = "";
		$dbName = "DVDRentals";
		$dbHost = "THIRDWORLD";
		if(!($link=mysql_pconnect($dbHost, $dbUser, $dbPass)))
		{
		    error_log(mysql_error(), 3, "/tmp/phplog.err");
		}
		if(!mysql_select_db($dbName, '127.0.0.1'))
		{
		    error_log(mysql_error(), 3, "/tmp/phplog.err");
		}
	
	    $queryDVD = "SELECT \* FROM DVDs";
	    $result = mysql_query($queryDVD, $link1);
	    $array1 = mysql_fetch($result);
	    print($array1);
	    mysql_close($link);
        ?>

Expected result:
----------------
At least an attempted connect to the database.

Actual result:
--------------
Connect To MySQL Server and List DVD's

Fatal error: Call to undefined function mysql_pconnect() in D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\listDVDs.html on line 14

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-07-11 23:14 UTC] tony2001@php.net
You're mixing modules from different versions of PHP.
 [2006-07-12 02:04 UTC] rodney at nerdsindenial dot com
Performed the following steps:

   1. Removed PHP via Add/Remove Programs  from control panel application in Windows XP.
   2. Deleted entire PHP directory.  Saved php.ini configuration file before deletion.
   3. Unzipped and extracted php5.2-win32-200607112230.zip
   4. Restored php.ini
   5. Restarted Apache 2.2.2 server

The results were unchanged in the ./apache2.2/logs/errors.log

[Tue Jul 11 18:01:11 2006] [notice] Parent: Received restart signal -- Restarting the server.
[Tue Jul 11 18:01:11 2006] [notice] Child 3280: Exit event signaled. Child process is ending.
[Tue Jul 11 18:01:12 2006] [notice] Child 3280: Released the start mutex
[Tue Jul 11 18:01:13 2006] [notice] Child 3280: Waiting for 250 worker threads to exit.
[Tue Jul 11 18:01:13 2006] [notice] Child 3280: All worker threads have exited.
[Tue Jul 11 18:01:13 2006] [notice] Child 3280: Child process is exiting
[Tue Jul 11 18:06:35 2006] [notice] Apache/2.2.2 (Win32) PHP/5.2.0-dev configured -- resuming normal operations
[Tue Jul 11 18:06:35 2006] [notice] Server built: Apr 29 2006 18:32:31
[Tue Jul 11 18:06:35 2006] [notice] Parent: Created child process 1764
PHP Warning:  PHP Startup: mysql: Unable to initialize module\nModule compiled with module API=20060613, debug=0, thread-safety=1\nPHP    compiled with module API=20050922, debug=0, thread-safety=1\nThese options need to match\n in Unknown on line 0
PHP Warning:  PHP Startup: snmp: Unable to initialize module\nModule compiled with module API=20060613, debug=0, thread-safety=1\nPHP    compiled with module API=20050922, debug=0, thread-safety=1\nThese options need to match\n in Unknown on line 0
PHP Warning:  PHP Startup: sockets: Unable to initialize module\nModule compiled with module API=20060613, debug=0, thread-safety=1\nPHP    compiled with module API=20050922, debug=0, thread-safety=1\nThese options need to match\n in Unknown on line 0
[Tue Jul 11 18:06:51 2006] [notice] Child 1764: Child process is running
[Tue Jul 11 18:06:51 2006] [notice] Child 1764: Acquired the start mutex.
[Tue Jul 11 18:06:51 2006] [notice] Child 1764: Starting 250 worker threads.
[Tue Jul 11 18:06:51 2006] [notice] Child 1764: Starting thread to listen on port 80.

Thank you for your response.  If I were only looking at the modification dates I would
say there was a mix of 2 different installations.  The API dates in the error log look
like internal timestamps picked up by PHP StartUp.  It looks like a new link/build with
an old compiled DLL of libmysql.dll.  I believe that the php_mysql.dll is build on top of
this to support get_module().  After performing the steps above, the results did not change.

Irie, and many thanks
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 13:01:27 2025 UTC