Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 849
  • Last Modified:

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?
0
JerryNorton
Asked:
JerryNorton
  • 4
  • 4
  • 2
1 Solution
 
dr_dedoCommented:
u need to compile php with mysql to work fine ! your PHP version is the new,  not mySQL

did u install PHP or it came pre installed with OS ??
if u installed it ur self from a source file, configure PHP again with these options while mysql 5 is installed
./configure --with-mysql --with-apxs=/www/bin/apxs

or
./configure --with-mysql=/path/to/mysql/bin --with-apxs=/www/bin/apxs
0
 
JerryNortonAuthor Commented:
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?)
0
 
dr_dedoCommented:
./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
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
JerryNortonAuthor Commented:
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)
0
 
dr_dedoCommented:
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
0
 
JerryNortonAuthor Commented:
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

0
 
dr_dedoCommented:
why this doesn't look good ?? it's telling you that php is recognizing mysql, and should be running fine !!!
0
 
Marcus BointonCommented:
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.
0
 
Marcus BointonCommented:
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).
0
 
JerryNortonAuthor Commented:
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.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now