ID: 37630
Updated by: [EMAIL PROTECTED]
Reported By: openmacnews at gmail dot com
Status: Open
Bug Type: MySQL related
Operating System: osx
PHP Version: 5.1.4
New Comment:
The switch to enable thread safety is --enable-maintainer-zts. The
name suggests though, that you shoulnd't use it unless you've got a
really good reason to do so.
Now about the reentrancy issues of the mysql extensions:
None of ext/mysql, ext/mysqli, ext/pdo_mysql check for the reentrant
version of the client library if ZTS is enabled.
ext/mysql though, calls mysql_thread_init() and mysql_thread_end() and
thus cause sort of a deadlock if linked against libmysqlclient_r.
Just a recap, no fix yet.
Previous Comments:
------------------------------------------------------------------------
[2006-05-30 16:34:35] openmacnews at gmail dot com
mike,
great. rather than dribbles of info, can you, then, please specify what
configuration option does and how to end up linked agaist only the
right/single library?
bottom line is i'm looking for thread-safe php + mysql, linked against
libmysqlclient_r.
let's just say the documentation hasn't been, at least for me,
forthcoming on the matter ...
------------------------------------------------------------------------
[2006-05-30 16:22:54] [EMAIL PROTECTED]
This configure flag does not enable thread safety.
------------------------------------------------------------------------
[2006-05-30 15:44:09] openmacnews at gmail dot com
hi mike,
of course.
sorry, i should have specified rather than assumed it would be obvious
...
i have built php "--with-tsrm-pthreads".
same issue, one vs both libs linked.
------------------------------------------------------------------------
[2006-05-30 13:14:21] [EMAIL PROTECTED]
>i've built mysql 5.0.21 threadsafe -- hence, the link target >needs to
be the _reentrant_ libmysqlclient_r
No. If you don't build a threaded client, you don't need to link
against the reentrant client libraries.
------------------------------------------------------------------------
[2006-05-29 15:54:56] openmacnews at gmail dot com
Description:
------------
hi all,
i'm building php-5.1.4 from source on osx 10.4.6
i've built mysql 5.0.21 threadsafe -- hence, the link target needs to
be the _reentrant_ libmysqlclient_r.
if i configure php as:
setenv CPPFLAGS "-I/usr/local/mysql/include/mysql"
setenv LDFLAGS "-bind_at_load -L/usr/local/mysql/lib/mysql
-lmysqlclient_r"
./configure \
...
--enable-pdo \
--with-mysql=/usr/local/mysql \
--with-mysql-sock=/var/Process \
--with-pdo-mysql=/usr/local/mysql \
--with-apxs2=/usr/local/apache2/sbin/apxs \
...
the build completes w/o error, BUT, resultant libs & bins are built
linked against BOTH lmysqlclient_r AND lmysqlclient.
iiuc, this should NOT be the case.
to get around this, *prior* to config:
perl -pi -e 's/mysqlclient\,/mysqlclient_r\,/g'
ext/pdo_mysql/config.m4
perl -pi -e 's/mysqlclient\./mysqlclient_r\./g'
ext/pdo_mysql/config.m4
and after config, prior to *make*:
perl -pi -e 's/mysqlclient /mysqlclient_r /g' Makefile
perl -pi -e 's/mysqlclient\n/mysqlclient_r\n/g' Makefile
again, no errors, and the libs/bins are linked -- as expected --
against *only* the reentrant lib.
cheers,
richard
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37630&edit=1