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:
Code:
<?php
$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = 'mydb;
$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');
$dbname = 'mydb';
mysql_select_db($dbname);
?>
so I execute the test file, and I get the following error
Code:
[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:
Code:
Resolving Dependencies
--> Running transaction check
---> Package php-mysql.x86_64 0:5.1.6-27.el5 set to be updated
--> Processing Dependency: libmysqlclient.so.15(libmysqlclient_15)(64bit) for package: php-mysql
--> Processing Dependency: libmysqlclient.so.15()(64bit) 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 libmysqlclient.so.15
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 libmysqlclient.so.15 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?
[EDIT]:
I did a "yum whatprovides libmysqlclient.so.15" and am just pointed to the mysql-5.0.77 installs
[EDIT#2]:
I did find a copy of libmysqlclient.so.15, 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