#37739 [Opn->Csd]: In a threading environment, PHP's configure picks the wrong mysql library
| From: | derick@php.net | Date: | Thu, 08 Jun 2006 13:52:15 +0000 |
| Subject: | #37739 [Opn->Csd]: In a threading environment, PHP's configure picks the wrong mysql library | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-98184@lists.php.net to get a copy of this message | ||
ID: 37739
Updated by: derick@php.net
Reported By: stefan at whocares dot de
-Status: Open
+Status: Closed
Bug Type: MySQL related
Operating System: Solaris 10 (probably all)
PHP Version: 5.1.4
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2006-06-08 13:08:45] stefan at whocares dot de
Yup, fixes the problem for me (Tested on Solaris 10/SPARC).
Thanks!
------------------------------------------------------------------------
[2006-06-08 12:43:01] 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 09:03:08] stefan at whocares dot de
That should read libphp5.so. Sorry for the typo.
------------------------------------------------------------------------
[2006-06-08 09:02:00] 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).
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37739&edit=1