Hi,
I have a CentOS 3 server that I need to update to MySQL 5 + PHP4. I downloaded and installed the MySQL client and server RPM packages for Red Hat 3, including the Shared Compatibility Libraries which provide /usr/lib/libmysqlclient.so.10, .12, .14 and .15, which seems to be the recommended way of upgrading a MySQL 3 installation. I then went on to recompile PHP 4.4.7, which worked fine. But my PHP installation is still using libmysqlclient.so.10, which does not play 100% correctly with the current MySQL 5 server. I'd need it to use libmysqlclient.so.15. Apparently /usr/lib/php4/mysql.so is linked to libmysqlclient.so.10.
How do I update/replace/relink the php-mysql connector to have PHP talk to MySQL using the current client libraries?
Any hints'd greatly appreciated. Cheers, Dav
David Zentgraf wrote:
Hi,
I have a CentOS 3 server that I need to update to MySQL 5 + PHP4. I downloaded and installed the MySQL client and server RPM packages for Red Hat 3, including the Shared Compatibility Libraries which provide /usr/lib/libmysqlclient.so.10, .12, .14 and .15, which seems to be the recommended way of upgrading a MySQL 3 installation. I then went on to recompile PHP 4.4.7, which worked fine. But my PHP installation is still using libmysqlclient.so.10, which does not play 100% correctly with the current MySQL 5 server. I'd need it to use libmysqlclient.so.15. Apparently /usr/lib/php4/mysql.so is linked to libmysqlclient.so.10.
How do I update/replace/relink the php-mysql connector to have PHP talk to MySQL using the current client libraries?
Any hints'd greatly appreciated.
If you compile it on a machine that has only mysql-5.x and mysql-devel-5.x on it, it should then link against the proper files.
Hopefully you are making RPMS and not doing installs from source. I would also try to stay with the CentOS RPMS (in CentOS-4 we have php-4.3.9) as you know those will be supported and get security updates until 2012 ... BUT php-4 will most likely not last that long from php.net.
You should (though I have not tried it) be able to compile the php-4.3.9 SRPMS from CentOS-4 on CentOS-3. You might also get the mysql SRPMS for MySQL from the CentOS-4 CentOSPlus repo and recompile on CentOS-3.
If I was going to do mysql-5 and php-4 on CentOS-3, that is what I would do ... though I would most likely do it on CentOS-4 instead and get a newer version of apache too.
Thanks, Johnny Hughes
Johnny Hughes wrote on Tue, 23 Oct 2007 04:07:40 -0500:
php-4.3.9
Unfortunately, there's a lot of applications that need 4.4.3 and up.
Kai
On 23. Oct 2007, at 18:07, Johnny Hughes wrote:
If you compile it on a machine that has only mysql-5.x and mysql-devel-5.x on it, it should then link against the proper files.
Hopefully you are making RPMS and not doing installs from source.
I was tempted there for a second, but no, I'm using RPMs. ;-)
I would also try to stay with the CentOS RPMS (in CentOS-4 we have php-4.3.9) as you know those will be supported and get security updates until 2012 ... BUT php-4 will most likely not last that long from php.net.
The app that we're about to deploy was written for PHP4 (long story) and has not been tested on PHP5, so we want to run on 4 until we're sure it works well on 5.
You should (though I have not tried it) be able to compile the php-4.3.9 SRPMS from CentOS-4 on CentOS-3. You might also get the mysql SRPMS for MySQL from the CentOS-4 CentOSPlus repo and recompile on CentOS-3.
I wonder if that's not more trouble than it's worth? Both PHP and MySQL are basically working fine, only the connector libs seem to be lagging behind... Or am I missing something and it's just a symptom of a bigger problem?
If I was going to do mysql-5 and php-4 on CentOS-3, that is what I would do ... though I would most likely do it on CentOS-4 instead and get a newer version of apache too.
Wish I could go to CentOS 4, but our host *major expletive*, and others in Tokyo ain't any better. :-(
Chrs, Dav
David Zentgraf wrote on Tue, 23 Oct 2007 17:27:20 +0900:
How do I update/replace/relink the php-mysql connector to have PHP talk to MySQL using the current client libraries?
Have you tried renaming libmysqlclient.so.10? Also, are you sure that it is libmysqlclient.so.10 that is getting used and not the client coming with PHP? If I remember correctly PHP (at least before 5) links against a client library that comes with it's source by default. So, if you are building without specifying an external library it should use it's own for linking.
Kai
On 23. Oct 2007, at 19:32, Kai Schaetzl wrote:
Have you tried renaming libmysqlclient.so.10? Also, are you sure that it is libmysqlclient.so.10 that is getting used and not the client coming with PHP? If I remember correctly PHP (at least before 5) links against a client library that comes with it's source by default. So, if you are building without specifying an external library it should use it's own for linking.
Yes, pretty sure:
$ ldd /usr/lib/php4/mysql.so libmysqlclient.so.10 => /usr/lib/libmysqlclient.so.10 (0x00f72000)
I tried compiling PHP with '--with-mysql', '--with-mysql-dir=/usr' and without explicitly specifying it, always the same outcome. I'm kinda surprised that even the built-in mysqlclient libs don't work as I expect them to.
I was thinking about either renaming .so.10 or symlinking it to .so. 15, but I'd really prefer to not mess with these kind of things by hand and rather have everything updated correctly with the correct procedure of RPMming/compiling.
Chrs, Dav
David Christopher Zentgraf wrote:
On 23. Oct 2007, at 19:32, Kai Schaetzl wrote:
Have you tried renaming libmysqlclient.so.10? Also, are you sure that it is libmysqlclient.so.10 that is getting used and not the client coming with PHP? If I remember correctly PHP (at least before 5) links against a client library that comes with it's source by default. So, if you are building without specifying an external library it should use it's own for linking.
Yes, pretty sure:
$ ldd /usr/lib/php4/mysql.so libmysqlclient.so.10 => /usr/lib/libmysqlclient.so.10 (0x00f72000)
I tried compiling PHP with '--with-mysql', '--with-mysql-dir=/usr' and without explicitly specifying it, always the same outcome. I'm kinda surprised that even the built-in mysqlclient libs don't work as I expect them to.
I was thinking about either renaming .so.10 or symlinking it to .so.15, but I'd really prefer to not mess with these kind of things by hand and rather have everything updated correctly with the correct procedure of RPMming/compiling.
If you are building RPMS, look at mock.
Mock will allow you to get a clean buildroot for all your package builds. All CentOS-4 and CentOS-5 RPMS (except some kmods) are now built with mock.
Mock does require that all the BuildRequires are correct for the SRPM, as it installs a base + the build requirements for the SRPM only.
Thanks, Johnny Hughes
David Christopher Zentgraf wrote on Tue, 23 Oct 2007 19:57:12 +0900:
I tried compiling PHP with '--with-mysql', '--with-mysql-dir=/usr' and without explicitly specifying it, always the same outcome.
Of course. I'm not an expert in this, but I guess when you specify the lib directory it is going to use the first lib that is supposed to work.
I'm
kinda surprised that even the built-in mysqlclient libs don't work as I expect them to.
I'm not. I think these are older ones, backwards-compatible.
I was thinking about either renaming .so.10 or symlinking it to .so.
symlinking won't help as this may affect other software. You have to get it out of the way, so the linker has a chance to find another lib.
15, but I'd really prefer to not mess with these kind of things by hand and rather have everything updated correctly with the correct procedure of RPMming/compiling.
Well, the problem is that you have several client libraries on the machine. AFAIK there is no way to specify a specific version of it, so you have to move the others out of the way when you build (by renaming). Later you can put them back.
Kai
On 23. Oct 2007, at 21:15, Kai Schaetzl wrote:
Well, the problem is that you have several client libraries on the machine. AFAIK there is no way to specify a specific version of it, so you have to move the others out of the way when you build (by renaming). Later you can put them back.
I see. I'll try the renaming and see how that works out.
Chrs, Dav
On 23. Oct 2007, at 21:15, Kai Schaetzl wrote:
Well, the problem is that you have several client libraries on the machine. AFAIK there is no way to specify a specific version of it, so you have to move the others out of the way when you build (by renaming). Later you can put them back.
I see. I'll try the renaming and see how that works out.
Well, I moved all libmysqlclient* files out of /usr/lib except for libmysqlclient.so.15.0.0 and a few symlinks to it. Reconfigured, made, made installed PHP --with-mysql=shared,/usr, moved all the libs back and restarted Apache... Same thing. :-(
David Christopher Zentgraf wrote on Tue, 23 Oct 2007 21:52:33 +0900:
Same thing.
And what dependency does ldd show now? I think what Johnny proposed should you help out of this.
Kai
On 24. Oct 2007, at 5:32, Kai Schaetzl wrote:
And what dependency does ldd show now? I think what Johnny proposed should you help out of this.
Same dependencies as before. I'll look at mock as suggested. Since I've never used it before, would you mind elaborating a bit what it'll do for me?
Cheers, Dav
On 10/23/07, David Christopher Zentgraf deceze@gmail.com wrote:
On 24. Oct 2007, at 5:32, Kai Schaetzl wrote:
And what dependency does ldd show now? I think what Johnny proposed should you help out of this.
Same dependencies as before. I'll look at mock as suggested. Since I've never used it before, would you mind elaborating a bit what it'll do for me?
Cheers, Dav
Not a CentOS page, but may provide you with some info:
http://fedoraproject.org/wiki/PackageMaintainers/MockTricks
Akemi
On 24. Oct 2007, at 11:38, Akemi Yagi wrote:
Not a CentOS page, but may provide you with some info:
Hmm, okay, so far so good. But how to I best get mock? It's not in CentOS 3's yum as far as I can see, and that's about the only installation source recommended by the site.
Chrs, Dav
David Christopher Zentgraf wrote on Wed, 24 Oct 2007 11:18:48 +0900:
Same dependencies as before.
Hm, I don't see how it can build then. If it depends on a linked library that you moved away it should not build I think.
Anyway, I really suggest you ask on comp.lang.php. This is not a CentOS but a PHP problem. They should be able to help you.
Kai