Mysql Libraries didn't get installed for PHP on install...

Jugernot

Diamond Member
Oct 12, 1999
6,889
0
0
I just installed Redhat 8 and it seems the MySQL libraries didn't get installed, so now I need to get them on the server. What would my best option be? Should I compile from new source? If yes, doesn't anyone know of a doc that will walk me through the process of recompiling for Apache 2.0.40?

I'm a real newbie, so be gentle.
 

GigaCluster

Golden Member
Aug 12, 2001
1,762
0
0
First, get the source for MySQL. Unzip, compile, install. Then, you have to recompile PHP with MySQL support. The option is "--with-mysql", and if it doesn't see the MySQL files, do "--with-mysql=/path/to/mysql". Then, after PHP is compiled, install it.

If your Apache is set up to process PHP files, then you don't need to do anything else to it.
 

Jugernot

Diamond Member
Oct 12, 1999
6,889
0
0
Gigacluster, I tried what you wrote (and btw, I tried to compile according to the install instructions with PHP) and neither worked. Either one errored out at a single components of the compile. Here is the "Configure Command" Section of my phpinfo page:

'./configure' '--host=i686-pc-linux-gnu' '--build=i686-pc-linux-gnu' '--target=i386-redhat-linux-gnu' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--prefix=/usr' '--with-config-file-path=/etc' '--enable-force-cgi-redirect' '--disable-debug' '--enable-pic' '--disable-rpath' '--enable-inline-optimization' '--with-bz2' '--with-db3' '--with-curl' '--with-dom=/usr' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-gd' '--enable-gd-native-ttf' '--with-ttf' '--with-gdbm' '--with-gettext' '--with-ncurses' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-png' '--with-pspell' '--with-regex=system' '--with-xml' '--with-expat-dir=/usr' '--with-zlib' '--with-layout=GNU' '--enable-bcmath' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-safe-mode' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-discard-path' '--enable-track-vars' '--enable-trans-sid' '--enable-yp' '--enable-wddx' '--without-oci8' '--with-pear=/usr/share/pear' '--with-imap=shared' '--with-imap-ssl' '--with-kerberos=/usr/kerberos' '--with-ldap=shared' '--with-mysql=shared,/usr' '--with-pgsql=shared' '--with-snmp=shared,/usr' '--with-snmp=shared' '--enable-ucd-snmp-hack' '--with-unixODBC=shared' '--enable-memory-limit' '--enable-bcmath' '--enable-shmop' '--enable-versioning' '--enable-calendar' '--enable-dbx' '--enable-dio' '--enable-mcal' '--with-apxs2=/usr/sbin/apxs'

When I recompile, do I have to use every one of these....?

It has --with-mysql=shared,/usr listed in there.... so it should have the libraries installed no? I wonder if this isn't my problem? Anyway, can you take a look at my phpinfo.php page? I don't see a "MySQL" section in the bottom, so I'm guessing my initial conclusion that the libraries aren't installed is correct?

btw: MySQL is already installed and working...

Thanks much!
 

manly

Lifer
Jan 25, 2000
13,075
3,831
136
What's wrong with using the stock precompiled MySQL that has shipped with Red Hat Linux for some time now? Or is the question whether MySQL comes with Red Hat? Well it does:

ftp://ftp.webtrek.com/pub/mirrors/redhat/linux/8.0/en/os/i386/RedHat/RPMS/mysql-3.23.52-3.i386.rpm
ftp://ftp.webtrek.com/pub/mirrors/r...86/RedHat/RPMS/mysql-devel-3.23.52-3.i386.rpm

As long as the versions of server daemons supported by the distribution vendor are acceptable to you, then supported, precompiled packages are the way to go. They've already been compiled to integrate together nicely. This infrastructure is now commonly called LAMP: Linux, Apache, MySQL, PHP.

As far as controlling which packages get installed during the initial setup, that has always been a slight challenge with any distro. Odds are its easy to install too much (worse, traditionally too many daemons were started by default) or you'd have to wrestle with a crufty interface like Debian's dselect for hours to fine tune the package selections.

Red Hat Linux 8.0 now has an installer GUI modeled after Windows Add/Remove Programs. It seems quite well done, although it may not front-end ALL of the hundreds of software applications in Red Hat Linux, maybe just the most commonly useful ones.

Okay, I just realized this was a specific question regarding MySQL + PHP integration. How about this package:
ftp://ftp.webtrek.com/pub/mirrors/r...86/RedHat/RPMS/php-mysql-4.2.2-8.0.5.i386.rpm

I won't edit my original message, because it stills begs the question why compile from scratch when it's unnecessary, time-consuming and error-prone. But I realize UNIX tradition has a lot to do with that. :)
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
Note that the version of MySQL shipped with RedHat 8 has problems ... my install was hanging/dying periodically. Get the current RPMs from the MySQL site and all should be well.

The rpm for the MySQL libraries is something like mysql-devel ... The PHP installed by RedHat 8 has MySQL support.
 

Jugernot

Diamond Member
Oct 12, 1999
6,889
0
0
Ok, maybe I just need to reinstall MySQL... My question wasn't if MySQL was installed or not, as it was on install, but rather if I had the necassary PHP libraries to connect to it.... When I try to connect to MySQL via a PHP connect, I get the following:

Fatal error: Call to undefined function: mysql_connect() in /usr/local/webroot/theactualdot.com/movie/index.php on line 40

I looked on the net and it seems that appears when you don't have the correct PHP libraries installed, so that is where I started out. I'll get the newest rpm from mysql.com and upgrade that and see what happens.

Thanks guys, you've been lots of help!
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
do this and post the results:

rpm -qa | grep -i mysql
rpm -qa | grep -i php

Unfortunately, my box isn't up at the moment to give you a list of what should be installed, but maybe somebody else can.

There is also some change to the PHP configuration that I had to adjust to make things work as they did with RH7.2 Again, my box is gone, so I can't give specifics :(
 

Jugernot

Diamond Member
Oct 12, 1999
6,889
0
0
rpm -qa | grep -i mysql
mysql-3.23.52-3
mysql-server-3.23.52-3
perl-DBD-MySQL-2.1017-3

php-4.2.2-8.0.5
php-ldap-4.2.2-8.0.5
php-imap-4.2.2-8.0.5

I tried upgrading MySQL using the newest from mysql.com and got the following:

[root@Spark root]# rpm -U MySQL-3.23.53a-1.i386.rpm
error: Failed dependencies:
libmysqlclient.so.10 is needed by (installed) mysql-server-3.23.52-3
libmysqlclient.so.10 is needed by (installed) perl-DBD-MySQL-2.1017-3

I looked and it seems that libmysqlclient.so.10 is provided in the rpm (the one that is complaing about not having it...) . so I'm not sure what to do from here.

 

Armitage

Banned
Feb 23, 2001
8,086
0
0
Originally posted by: Jugernot
rpm -qa | grep -i mysql
mysql-3.23.52-3
mysql-server-3.23.52-3
perl-DBD-MySQL-2.1017-3

php-4.2.2-8.0.5
php-ldap-4.2.2-8.0.5
php-imap-4.2.2-8.0.5

I tried upgrading MySQL using the newest from mysql.com and got the following:

[root@Spark root]# rpm -U MySQL-3.23.53a-1.i386.rpm
error: Failed dependencies:
libmysqlclient.so.10 is needed by (installed) mysql-server-3.23.52-3
libmysqlclient.so.10 is needed by (installed) perl-DBD-MySQL-2.1017-3

I looked and it seems that libmysqlclient.so.10 is provided in the rpm (the one that is complaing about not having it...) . so I'm not sure what to do from here.

You can't upgrade the RedHat provided mysql rpm(s) with the mysql provided rpm(s). They split things up differently. Uninstall the redhat mysql rpm(s), and then install the new ones. One thing I think you are missing from your current install is the mysql devel package.
 

n0cmonkey

Elite Member
Jun 10, 2001
42,936
1
0
Originally posted by: Jugernot
rpm -qa | grep -i mysql
mysql-3.23.52-3
mysql-server-3.23.52-3
perl-DBD-MySQL-2.1017-3

php-4.2.2-8.0.5
php-ldap-4.2.2-8.0.5
php-imap-4.2.2-8.0.5

I tried upgrading MySQL using the newest from mysql.com and got the following:

[root@Spark root]# rpm -U MySQL-3.23.53a-1.i386.rpm
error: Failed dependencies:
libmysqlclient.so.10 is needed by (installed) mysql-server-3.23.52-3
libmysqlclient.so.10 is needed by (installed) perl-DBD-MySQL-2.1017-3

I looked and it seems that libmysqlclient.so.10 is provided in the rpm (the one that is complaing about not having it...) . so I'm not sure what to do from here.

I dont think its saying it is missing anything. What it is saying is that libmysqlclient.so.10 is required by mysql-server-3.23.52-3 and perl-DBD-MySQL-2.1017-3 so it cannot be uninstalled. Remove the other two first and you should be able to install the file you are trying to install. Although, ergeorge's assessment is probably also correct.
 

mjquilly

Golden Member
Jun 12, 2000
1,692
0
76
Originally posted by: ergeorge
you may have to use the --force or --nodeps option to uninstall the redhat mysql rpms.

i just did a fresh install of Apache/MySql/PHP on RH 8, and I had to uninstall w/ --nodeps (is that the option?). I found a great stepthrough of the whole process on google, if i can find it, i'll post a link
 

Jugernot

Diamond Member
Oct 12, 1999
6,889
0
0
Thanks guys!

mjquilly, that would be extremely helpful if you could find that link for me. THanks

EDIT: I got it working (limping along) using the comments from this post Search result from google. Though, mjquily, I'm still quite interested in getting this stock install off and getting a custom install going... so if you find that URL, pass it my way. Please... Thanks
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
you may have to use the --force or --nodeps option to uninstall the redhat mysql rpms.

You should never use --nodeps, dependencies is the whole point of the database. If you're going to use --nodeps you might as well just compile from source because your rpm database is useless now anyway.
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
Originally posted by: Nothinman
you may have to use the --force or --nodeps option to uninstall the redhat mysql rpms.

You should never use --nodeps, dependencies is the whole point of the database. If you're going to use --nodeps you might as well just compile from source because your rpm database is useless now anyway.


I use it in this case because I have to replace the mysql install. Without it, you would have to

1. uninstall all the packages that depend on mysql
2. and then uninstall mysql
3. install new mysql
4. reinstall the dependent packages.

Using nodeps eliminates step1 1 and 4, but their is a risk that some of the dependencies may not be satisfied by the upgraded mysql. In practice, for this case, it works.

Would be nice if the rpm program had a replace option. There is a replacefiles and replacepkgs option, but from looking at the man page, it doesn't seem like what is needed here. My new install is almost done, so maybe I'll experiment with those options.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Using nodeps eliminates step1 1 and 4, but their is a risk that some of the dependencies may not be satisfied by the upgraded mysql. In practice, for this case, it works.

Also in this case it's probably only needed by 2 or 3 other packages, probably just perl-dbd and php-mysql.

And while it'll probably work, it's not a good habit to get into.

Would be nice if the rpm program had a replace option.

If RedHat and MySQL would use the same package names it would be easy to 'upgrade' them.