LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (http://www.linuxquestions.org/questions/red-hat-31/)
-   -   PHP and mysql configuration problem (http://www.linuxquestions.org/questions/red-hat-31/php-and-mysql-configuration-problem-4175475110/)

sathish03 08-29-2013 12:57 AM

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

bathory 08-29-2013 02:03 AM

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

sathish03 08-29-2013 02:15 AM

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?.

bathory 08-29-2013 02:40 AM

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

ArcLinux 08-29-2013 02:47 PM

Quote:

Originally Posted by sathish03 (Post 5018011)
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.

sathish03 09-06-2013 03:47 AM

Thanks to all.


All times are GMT -5. The time now is 10:41 AM.