Link to home
Start Free TrialLog in
Avatar of JerryNorton
JerryNorton

asked on

How to upgrade linked Mysql library for php?

OS is redhat ES 3.0
Mysql is 5.0.28 --> not the one that came with redhat, I installed it for another application...not shared
PHP installed is 4.3.2
Trying to install mediawiki 1.6.5

mediawiki uses php, mysql and apache.
On installation, its automated configuration gui gives me an error regarding PHP:

"PHP is linked with old MySQL client libraries.If you are using a MySQL 4.1 server and have problems connecting to the database, see http://dev.mysql.com/doc/mysql/en/old-client.html for help"

I am not using 4.1 (I am using 5.0) and am not sure this is anywhere near my problem.
Can I just upgrade PHP somehow? I see tons of dependencies all around. My other applications use perl, so not too worried about them, but I do not want to reinstall apache or mysql if I can avoid it.

I tried to install php-5.1.4 in /usr/local, but configure failed due to libxml2 being at too low a version. Of course that has a million dependencies.

Any quick guide to what/how to upgrade necessary pieces?
ASKER CERTIFIED SOLUTION
Avatar of dr_dedo
dr_dedo
Flag of Egypt image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JerryNorton
JerryNorton

ASKER

No, it got installed with OS, I did

rpm -e php php-devel php-imap php-ldap php-mysql php-odbc php-pgsql squirrelmail

(squirrelmail showed up in the dependencies)

I then tried (see above) to install php-5.1.4, but got an error from configure requiring libxml2 at higher rev.  Should I just try to install 4.3.2 from binary? and configure as you suggest? are there configure options to tell it the mysql directory to use (so it uses the mysql 5 that is installed instead of any mysql 3 stuff left over from redhat?)
./configure --with-mysql=/path/to/mysql/bin --with-apxs=/www/bin/apxs
won't ask u for libxml2 !!

just have php documents ready and follow them. i do recommend that u use apache 1.3 and php compile into PHP not as a module
well, not really getting too far here. Now PHP does not work at all.
I don't have /www/bin/apxs, i have /usr/sbin/apxs, but I am running apache 2.0, cant see any apxs2....
Also, I simply downloaded and tried to install a 4.4 version of php, not 5.1.4, since that libxml2 issue DID NOT go away with any other instruction.
The other thing is that the path on my system seems to be /etc/httpd/modules/*.so, but this built in /usr/lib/httpd/modules/*.so. The httpd.conf puts this path in, but do i need to worry about permissions? add apache to the group?
(close to ready to giving up)
i guess u didn't do a manual installation of PHP, apache and mysql before. first one won't be a breath though. but there is always a first time.
it is always, i do mean always, a good idea to install your database first and refer to it while installing php
i hate it when things got screwed that way and get that messy. if you can, and this is your personal box, u can remove epache and php and start from the begining. If you are welling to that, then grap your self a copy of apache 1.3 and php5 and i'll escort you during that sweet process of installation :D
I did get PHP running, by redoing the install and noticing (mea culpa) the small line:
libtool: install: warning: remember to run `libtool --finish /usr/local/php-4.4.2/libs'
in the output of make install (why wouldn't that be part of the script, one wonders...easier to make note than to run it?)
I also added the application to the httpd.conf, for some reason thought that it was already there.

With PHP running, I now had phpinfo() tell me all about my install...all looked good except:
MySQL Support enabled
Active Persistent Links  0  
Active Links  0  
Client API version  3.23.58  
MYSQL_MODULE_TYPE  external  
MYSQL_SOCKET  /tmp/mysql.sock  
MYSQL_INCLUDE  -I/usr/local/mysql/include  
MYSQL_LIBS  -L/usr/local/mysql/lib -lmysqlclient -lz  


Please, where does PHP find the Client API version?  Can I do something else with config? In /usr/local/mysql/lib I have version 5.0.18 of libmysqlclient.a and libmysqlclient_r.a

why this doesn't look good ?? it's telling you that php is recognizing mysql, and should be running fine !!!
Avatar of Marcus Bointon
FWIW, my config doesn't seem to have any trouble picking up new versions of the MySQL client libs when recompiling PHP. The paths I use in config (I'm on OS X, but it's all the same) are (to enable both mysql and mysqli):

--with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config

It might be worth a quick 'which mysql' and 'mysql --version' to make sure you have not got an old installation lying about.
Also, there's no such thing as MySQL 5.0.28! Current release is 5.0.21. I'm also running that on RedHat EL4 (where I'm suffering a descent into RPM and apt-get hell at present).
Hi, for anyone reading all the way to the bottom:

Never was able to use PHP 5.1.4
Final solution for getting rid of mysqlclient being below rev was to issue
rpm -e mysql mod_auth_mysql perl-DBD-MySQL libdbi-dbd-mysql MySQL-python MyODBC qt-MySQL php-mysql mysql-bench mysql-devel
to remove some old stuff other rpm -e's missed.
This gave me the correct client version for my main installation of mysql.

I would give points to Squinky as well, but don't know how.