Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-05-2010, 04:59 PM   #1
LQ Newbie
Registered: Mar 2010
Posts: 29

Rep: Reputation: 1
PHP 5.1.6 & MySQL 5.0.34 connectivity test, php-mysql & libmysqlclient_15

Part of a larger project that I have, one task is to test PHP connectivity to MySQL, but I've currently been given the requirement of certain legacy binary versions - otherwise I would just YUM this and be done with it. However, I've been rolling everything via RPM's - now the problem:

This is on CentOS 5.5 x86_64, PHP 5.1.6, and MySQL 5.0.34

I have a mysqltest.php file:

$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = 'mydb;

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die                      ('Error connecting to mysql');

$dbname = 'mydb';
so I execute the test file, and I get the following error

[root@CentOS5 html]# php mysqltest.php 
PHP Fatal error:  Call to undefined function mysql_connect() in
/var/www/html/mysqltest.php on line 6
Some research shows me that I need php-mysql installed. Except when I try to yum this, I get:

Resolving Dependencies
--> Running transaction check
---> Package php-mysql.x86_64 0:5.1.6-27.el5 set to be updated
--> Processing Dependency: for package: php-mysql
--> Processing Dependency: for package: php-mysql
--> Running transaction check
---> Package mysql.x86_64 0:5.0.77-4.el5_5.3 set to be updated
--> Processing Conflict: mysql conflicts MySQL
--> Finished Dependency Resolution
mysql-5.0.77-4.el5_5.3.x86_64 from updates has depsolving problems
  --> mysql conflicts with MySQL-server-enterprise-gpl
Error: mysql conflicts with MySQL-server-enterprise-gpl
 You could try using --skip-broken to work around the problem
 You could try running: package-cleanup --problems
                        package-cleanup --dupes
                        rpm -Va --nofiles --nodigest
I actually dug around and finally found a copy of php-mysql-5.1.6-1.4.x86_64.rpm, but it's complaining about

I thought that this libmysqlclient would be handled by this package: MySQL-devel-enterprise-gpl-5.0.34-0.rhel4.x86_64.rpm - even though I ran "rpm -ivh" on it, and it showed 100% completion.. when I run "rpm -ql MySQL-devel-enterprise-gpl-5.0.34-0.rhel4.x86_64.rpm" it says its not installed.

there are some copies of on Rpm.Pbone - but they are for OpenSuse and Mandriva - nothing for FC, RHEL, CentOS, etc

Do I just need to keep sleuthing through the interwebs till I find this, or is there a better way to skin this cat?


I did a "yum whatprovides" and am just pointed to the mysql-5.0.77 installs


I did find a copy of, downloaded, moved to /usr/lib64 - but running "rpm -ivh php-mysql-5.1.6" still produces same missing dependency. This is probably super noob - but how do I force it to see this?
Thanks in advance

other info:

Installed Packages
php.x86_64 5.1.6-27.el5 installed
php-cli.x86_64 5.1.6-27.el5 installed
php-common.x86_64 5.1.6-27.el5 installed
php-devel.x86_64 5.1.6-27.el5 installed
php-pdo.x86_64 5.1.6-27.el5 installed
php-pear.noarch 1:1.4.9-6.el5 installed
php-pgsql.x86_64 5.1.6-27.el5 installed

MySQL-client-enterprise-gpl.x86_64 5.0.34-0.rhel4 installed
MySQL-devel-enterprise-gpl.x86_64 5.0.34-0.rhel4 installed
MySQL-server-enterprise-gpl.x86_64 5.0.34-0.rhel4 installed

Last edited by kapshure; 08-05-2010 at 05:42 PM.
Old 08-05-2010, 07:11 PM   #2
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911
Not sure which route you should go down... you can't force yum (rpm)
to see a file you manually copied - it uses its database.

You could try a forced install of the old packages and HOPE it
all works (man rpm, /force /-no-deps)

You could build mysql & php from source, and install those
in different directories from the distro provided ones.

Personally I'd choose the source builds.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Slackware guide for AMP Apache MySQL & PHP xushi Slackware 35 05-11-2006 11:18 AM
PHP & MySQL Count on PHP Gerardoj Programming 1 06-01-2004 10:43 AM
From RedHat9 to FreeBSD (Apache 2 & Mysql & PHP 4) guardian653 *BSD 5 12-11-2003 05:31 PM
Apache & PHP & Mysql thomas050682 Linux - Networking 5 03-03-2003 03:21 PM
Apache & Php & MySql te_conway Linux - Software 2 12-21-2001 04:06 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:04 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration