Re: [Sqlrelay-discussion] Sqlrelay 0.39.4 + dropin mysql library + PHP 5.1.6 + MySQL 5.0.22
Brought to you by:
mused
|
From: David M. <dav...@fi...> - 2008-06-13 18:01:25
|
On Fri, 2008-06-13 at 10:19 +0300, Jani Ollikainen wrote:
> David Muse wrote:
> > PHP actually contains it's own copy of the mysql client library that is
> > compiled into PHP itself. Since it doesn't dynamically load the mysql
> > client library, it can't be overridden with the SQL Relay drop-in
> > library.
>
> Oh, This explains why there is that license exception for PHP :)
>
> > A long time ago, it was possible to build PHP such that it dynamically
> > linked in the mysql client library. But I don't believe that option
> > exists any more, and may not have for a while.
>
> What would that option have been or where to look if one might want to
> search that possibility? Then these configure parameters must just mean
> that they are not builded into php binary itself
> '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config'
> but they still use own mysql code?
Hmm, those look like the correct parameters. I suspect using those
parameters will link against the libmysqlclient library, not against
PHP's code. Give them a try. What version of PHP are they in?
>
> > Unfortunately, at this time, the only solution would be to find a
> > version of PHP that dynamically links to mysql and use it if you can.
>
> Most probably too old PHP's and not suitable for OO coding.
>
> > I've been looking into what it would take to remap mysql calls in PHP,
> > but I haven't come up with a solution yet.
> > Sorry for the bad news.
>
> Well, we made couple of classes to emulate PDO's basic features which
> we need. More work and not so nice but it seems to do it's work and
> that's what counts.
>
> And of course requests are easy to say and the coding is a big job
> but PDO or MDB2 driver for sqlrelay would be nice. As Pear DB is now
> "obsolete" and superseded with MDB2. Pear DB doesn't feel like the right
> choice to use in new projects.
Yeah, MDB2 is on the TODO list, not sure when I'll get around to it
though :/
Dave
>
>
> > David Muse
> > dav...@fi...
> >
> > On Thu, 2008-06-05 at 11:34 +0300, Jani Ollikainen wrote:
> >> Jani Ollikainen wrote:
> >>
> >> And if this helps I straced the normal mysql client:
> >>
> >> connect(3, {sa_family=AF_FILE, path="/tmp/sqlrelay.sock"}, 110) = 0
> >> setsockopt(3, SOL_TCP, TCP_NODELAY, [1], 4) = -1 EOPNOTSUPP (Operation
> >> not suppo
> >> rted)
> >> write(3, "\0\0\0\10sqlrelay\0\0\0\tpass", 25) = 25
> >> read(3, "\0\1\0\0", 8192) = 4
> >> write(3, "\0\v\0\0\0\10sqlrelay\0\0\0\tpass", 27) = 27
> >> read(3, "\0\1", 8192) = 2
> >>
> >> It write()'s before tries to read() which PHP mysql
> >> doesn't do.
> >>
> >> PHP code for connection is:
> >>
> >> try {
> >> $dbh = new
> >> PDO("mysql:unix_socket=/tmp/sqlrelay.sock;dbname=www",_SQLUSER, _SQLPASS);
> >> } catch (PDOException $e) {
> >> echo 'Connection failed: ' . $e->getMessage();
> >> }
> >>
> >> And the _SQLUSER and _SQLPASS are the user/pass for
> >> sqlrelay not for the mysql.
> >>
> >> With LD_PRELOAD defined the normal mysqlsocket connection
> >> works..
> >>
> >> connect(3, {sa_family=AF_FILE, path="/var/lib/mysql/mysql.sock"}, 110) = 0
> >> setsockopt(3, SOL_IP, IP_TOS, [8], 4) = -1 EOPNOTSUPP (Operation not
> >> supported
> >> )
> >> setsockopt(3, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
> >> read(3, "8\0\0\0\n5.0.22-log\0\371\4\0\0]Z,iN)#q\0,\242\10"..., 16384) = 60
> >>
> >> So it seems like for some reason the LD_PRELOAD won't do it's trick?
> >>
> >>
> >>> Hi,
> >>>
> >>> Subject is the problem.
> >>>
> >>> If I set the LD_PRELOAD cli mysql client
> >>> can connect and works nicely.
> >>>
> >>> But with PHP neither pdo_mysql or mysql
> >>> works. It just hangs when connecting.
> >>>
> >>> Strace says it is trying to connect the
> >>> right socket but it just cannot get anything from there.
> >>>
> >>> Any ideas?
> >>>
> >>> The system is CentOS.
> >>>
> >>> Strace output:
> >>> connect(3, {sa_family=AF_FILE, path="/tmp/sqlrelay.sock"}, 110) = 0
> >>> setsockopt(3, SOL_IP, IP_TOS, [8], 4) = -1 EOPNOTSUPP (Operation not
> >>> supported)
> >>> setsockopt(3, SOL_SOCKET, SO_KEEPALIVE, [1], 4) = 0
> >>> read(3,
> >>>
> >>> # ldd php-cli
> >>> linux-gate.so.1 => (0x00110000)
> >>> /usr/lib/libmysql50sqlrelay.so (0x0018a000)
> >>> libcrypt.so.1 => /lib/libcrypt.so.1 (0x00cf3000)
> >>> libaspell.so.15 => /usr/lib/libaspell.so.15 (0x005e4000)
> >>> libpspell.so.15 => /usr/lib/libpspell.so.15 (0x00ce8000)
> >>> libgmp.so.3 => /usr/lib/sse2/libgmp.so.3 (0x003ff000)
> >>> libdb-4.3.so => /lib/libdb-4.3.so (0x006a7000)
> >>> libpthread.so.0 => /lib/libpthread.so.0 (0x00c78000)
> >>> libcurl.so.3 => /usr/lib/libcurl.so.3 (0x005a6000)
> >>> libbz2.so.1 => /usr/lib/libbz2.so.1 (0x00de6000)
> >>> libz.so.1 => /usr/lib/libz.so.1 (0x00cd3000)
> >>> libpcre.so.0 => /lib/libpcre.so.0 (0x00dc7000)
> >>> libresolv.so.2 => /lib/libresolv.so.2 (0x00d4a000)
> >>> libm.so.6 => /lib/libm.so.6 (0x00c91000)
> >>> libdl.so.2 => /lib/libdl.so.2 (0x00c2a000)
> >>> libnsl.so.1 => /lib/libnsl.so.1 (0x00d23000)
> >>> libxml2.so.2 => /usr/lib/libxml2.so.2 (0x00472000)
> >>> libgssapi_krb5.so.2 => /usr/lib/libgssapi_krb5.so.2 (0x00d97000)
> >>> libkrb5.so.3 => /usr/lib/libkrb5.so.3 (0x00323000)
> >>> libk5crypto.so.3 => /usr/lib/libk5crypto.so.3 (0x00d5f000)
> >>> libcom_err.so.2 => /lib/libcom_err.so.2 (0x00ae3000)
> >>> libssl.so.6 => /lib/libssl.so.6 (0x003b8000)
> >>> libcrypto.so.6 => /lib/libcrypto.so.6 (0x001ee000)
> >>> libidn.so.11 => /usr/lib/libidn.so.11 (0x00435000)
> >>> libc.so.6 => /lib/libc.so.6 (0x00ae8000)
> >>> libsqlrclient-0.39.4.so.1 => /usr/lib/libsqlrclient-0.39.4.so.1
> >>> (0x00111000)
> >>> librudiments-0.31.so.1 => /usr/lib/librudiments-0.31.so.1
> >>> (0x0079e000)
> >>> librt.so.1 => /lib/librt.so.1 (0x0012a000)
> >>> libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x0081a000)
> >>> libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00d3c000)
> >>> /lib/ld-linux.so.2 (0x00ac6000)
> >>> libkrb5support.so.0 => /usr/lib/libkrb5support.so.0 (0x00d87000)
> >>> libkeyutils.so.1 => /lib/libkeyutils.so.1 (0x00d92000)
> >>> libselinux.so.1 => /lib/libselinux.so.1 (0x00cba000)
> >>> libsepol.so.1 => /lib/libsepol.so.1 (0x00c30000)
> >>>
> >>> -------------------------------------------------------------------------
> >>> Check out the new SourceForge.net Marketplace.
> >>> It's the best place to buy or sell services for
> >>> just about anything Open Source.
> >>> http://sourceforge.net/services/buy/index.php
> >>> _______________________________________________
> >>> Sqlrelay-discussion mailing list
> >>> Sql...@li...
> >>> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion
> >>
> >> -------------------------------------------------------------------------
> >> Check out the new SourceForge.net Marketplace.
> >> It's the best place to buy or sell services for
> >> just about anything Open Source.
> >> http://sourceforge.net/services/buy/index.php
> >> _______________________________________________
> >> Sqlrelay-discussion mailing list
> >> Sql...@li...
> >> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion
> >>
> >>
> >> __________________________________________________
> >> D O T E A S Y - "Join the web hosting revolution!"
> >> http://www.doteasy.com
> >
> >
> >
> > __________________________________________________
> > D O T E A S Y - "Join the web hosting revolution!"
> > http://www.doteasy.com
> >
> > -------------------------------------------------------------------------
> > Check out the new SourceForge.net Marketplace.
> > It's the best place to buy or sell services for
> > just about anything Open Source.
> > http://sourceforge.net/services/buy/index.php
> > _______________________________________________
> > Sqlrelay-discussion mailing list
> > Sql...@li...
> > https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion
>
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Sqlrelay-discussion mailing list
> Sql...@li...
> https://lists.sourceforge.net/lists/listinfo/sqlrelay-discussion
>
>
> __________________________________________________
> D O T E A S Y - "Join the web hosting revolution!"
> http://www.doteasy.com
__________________________________________________
D O T E A S Y - "Join the web hosting revolution!"
http://www.doteasy.com
|