php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37739 In a threading environment, PHP's configure picks the wrong mysql library
Submitted: 2006-06-08 09:02 UTC Modified: 2006-08-24 20:11 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: stefan at whocares dot de Assigned:
Status: Closed Package: MySQL related
PHP Version: 5.1.5 OS: Solaris 10 (probably all)
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: stefan at whocares dot de
New email:
PHP Version: OS:

 

 [2006-06-08 09:02 UTC] stefan at whocares dot de
Description:
------------
When compiling PHP as an Apache module, libmysqlclient.so will 
be used no matter whether it's a threading (worker) Apache or 
a standard (prefork) environment. Hoewever, in a threading 
environment, libmysqlclient_r.so would be the correct choice. 
Since all the threading checks in the configure script are 
done *after* picking the MySQL library to use, I don't see any 
easy way to fix this.
The best thing to do would be to check for the environment 
first and then use "mysql_config --libs_r" instead of 
"mysql_config --libs".

Reproduce code:
---------------
Just try to make PHP use the thread-safe libraries provided by MySQL. You'll fail. The only solution I've found is to call "configure" the way I want to and afterwards run "sed -e 's/mysqlclient/mysqlclient_r/g' Makefile > Makefile.ts; cp Makefile.ts Makefile".

Actual result:
--------------
As it happens, the CLI will work fine whereas the libphp4.so 
will report a "Cannot connect to MySQL ..." as stated here: 
http://bugs.mysql.com/bug.php?id=8472 (And this is way old, if 
I may say so).

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-08 09:03 UTC] stefan at whocares dot de
That should read libphp5.so. Sorry for the typo.
 [2006-06-08 12:43 UTC] tony2001@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2006-06-08 13:08 UTC] stefan at whocares dot de
Yup, fixes the problem for me (Tested on Solaris 10/SPARC).
Thanks!
 [2006-06-08 13:52 UTC] derick@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.
 [2006-08-24 20:11 UTC] stefan at whocares dot de
Just wanted to add that although the bug was fixed in 5.2-CVS, 
the fix seems to not have made it into 5.1.5
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 09:01:33 2025 UTC