LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices



Reply
 
Search this Thread
Old 08-29-2013, 01:57 AM   #1
sathish03
LQ Newbie
 
Registered: Aug 2013
Posts: 3

Rep: Reputation: Disabled
PHP and mysql configuration problem


Hi,
First i would like to explain my problem clearly and am beginner to Linux. I have an Dell server with redhat 5 OS. In that i have hosted one database using mysql and html+perl. It is located in /var/www/html/xxx folder. It is working fine but at present i want to host another database. That database created by using mysql and html+php. When i am moved that files to /var/www/html folder its working good with html file but the search (php) files are not working. Then tried to executing php file in command line i found error as
" PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/msql.so' - /usr/lib64/php/modules/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/test_php.php on line 2 "


This php file located in /var/www/html/test_php.php. That coding is

<?php
$link = mysql_connect('localhost', 'root', 'pass');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
echo 'Connected successfully';
mysql_close($link);
?>


Php installed on server but dont know it is configured or not.
I think php configuration was wrong. Pl help me to fix this problem and where am did wrong.

Thanks in advance.

Sathish
 
Old 08-29-2013, 03:03 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,974

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Quote:
PHP Fatal error: Call to undefined function mysql_connect() in /var/www/html/test_php.php on line 2 "
You miss the php-mysql package. As root run the following to install it
Code:
yum install php-mysql
Regards
 
Old 08-29-2013, 03:15 AM   #3
sathish03
LQ Newbie
 
Registered: Aug 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks for reply. In my server Yum function not working because of RHN registration problem. I have tried to install manually ( php-mysql-5.1.6-39.el5_8.x86_64.rpm) but it was failed due to dependencies such as,
# rpm -ivh php-mysql-5.1.6-39.el5_8.x86_64.rpm
warning: php-mysql-5.1.6-39.el5_8.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
error: Failed dependencies:
php-common = 5.1.6-39.el5_8 is needed by php-mysql-5.1.6-39.el5_8.x86_64
php-pdo is needed by php-mysql-5.1.6-39.el5_8.x86_64


Then i was tried to install failed dependencies,

# rpm -ivh php-common-5.1.6-27.el5.x86_64.rpm
Preparing... ########################################### [100%]
package php-common-5.1.6-27.el5_5.3.x86_64 (which is newer than php-common-5.1.6-27.el5.x86_64) is already installed
file /usr/lib64/php/modules/dbase.so from install of php-common-5.1.6-27.el5.x86_64 conflicts with file from package php-common-5.1.6-27.el5_5.3.x86_64
and
#rpm -ivh php-pdo-5.1.6-27.el5.x86_64.rpm
error: Failed dependencies:
php-common = 5.1.6-27.el5 is needed by php-pdo-5.1.6-27.el5.x86_64

Is there any alternate way to use yum command without RHN registration?.
 
Old 08-29-2013, 03:40 AM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,974

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Since you're using RHEL, you should register (and pay for support) with RHN.
Anyways, if you insist not to do so, you can have a look here to see how to use a Centos repository
 
Old 08-29-2013, 03:47 PM   #5
ArcLinux
Member
 
Registered: Apr 2005
Location: Fargo, ND
Distribution: Slackware, CentOS
Posts: 87

Rep: Reputation: 20
Quote:
Originally Posted by sathish03 View Post
Thanks for reply. In my server Yum function not working because of RHN registration problem. I have tried to install manually ( php-mysql-5.1.6-39.el5_8.x86_64.rpm) but it was failed due to dependencies such as,
# rpm -ivh php-mysql-5.1.6-39.el5_8.x86_64.rpm
warning: php-mysql-5.1.6-39.el5_8.x86_64.rpm: Header V3 DSA signature: NOKEY, key ID e8562897
error: Failed dependencies:
php-common = 5.1.6-39.el5_8 is needed by php-mysql-5.1.6-39.el5_8.x86_64
php-pdo is needed by php-mysql-5.1.6-39.el5_8.x86_64


Then i was tried to install failed dependencies,

# rpm -ivh php-common-5.1.6-27.el5.x86_64.rpm
Preparing... ########################################### [100%]
package php-common-5.1.6-27.el5_5.3.x86_64 (which is newer than php-common-5.1.6-27.el5.x86_64) is already installed
file /usr/lib64/php/modules/dbase.so from install of php-common-5.1.6-27.el5.x86_64 conflicts with file from package php-common-5.1.6-27.el5_5.3.x86_64
and
#rpm -ivh php-pdo-5.1.6-27.el5.x86_64.rpm
error: Failed dependencies:
php-common = 5.1.6-27.el5 is needed by php-pdo-5.1.6-27.el5.x86_64

Is there any alternate way to use yum command without RHN registration?.
You could use CentOS. CentOS is a community built distribution of the RH platform.
 
Old 09-06-2013, 04:47 AM   #6
sathish03
LQ Newbie
 
Registered: Aug 2013
Posts: 3

Original Poster
Rep: Reputation: Disabled
Thanks to all.
 
  


Reply


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
I have problem with configuration on apache, mysql and php for AMXbans hyperborea Linux - Server 1 09-26-2010 04:47 AM
Mysql 4.1 and PHP configuration? sikandar Linux - Software 2 05-30-2005 11:08 PM
Apache MySQL PHP configuration Gilion Linux - Software 1 02-02-2004 11:58 AM
apache php-mysql configuration problems ugol Linux - Software 1 11-08-2003 10:13 PM
PHP/MYSQL Configuration drweb Linux - Newbie 3 06-29-2003 03:11 PM


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

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