By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,521 Members | 1,447 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,521 IT Pros & Developers. It's quick & easy.

HELP: Fatal error: Call to undefined function: mysql_connect() in /var/www/html/index.php

P: n/a
BT
Hi .. a newbie question.
I get the following error:
Fatal error: Call to undefined function: mysql_connect() in
/var/www/html/index.php on line 3.

I have the following RPMS installed on RH7.2
MySQL-client-4.0.14-0 I would really appreciate it.
MySQL-shared-4.0.14-0
MySQL-server-4.0.14-0
MySQL-devel-4.0.14-0
php-imap-4.0.6-7
php-4.0.6-7
apache-1.3.20-16
apache-devel-1.3.20-16
apacheconf-0.8.1-1

The code i am trying to run is: I would really appreciate it.
<?php
printf("opening db.....");
$db = mysql_connect("localhost","user","password");
printf("closing db\n");
mysql_close($db);
?>

The configure part of phpinfo() shows:
-----
'./configure'
'i386-redhat-linux' '--prefix=/usr' .<snip>
'--enable-wddx' '--without-mysql' '--without-unixODBC'
'--without-oracle' '--without-oci8' '--with-pspell' '--with-xml'
------

I believe the mysql is not installed to work along with PHP. I
installed php using rpm.
My question is how do i make it work. I have checked NG and tested all
the options. But to no avail.

I also tried by uncommenting the line extensin=mysql.so in
/etc/php.ini.

Can somebody please help. Is there any other information you require?
I would really appreciate it.

TIA
-BT
Jul 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
You forgot to install the php-mysql RPM

(http://mirror.aarnet.edu.au/pub/linu...0.6-7.i386.rpm)
Grant

BT wrote:
Hi .. a newbie question.
I get the following error:
Fatal error: Call to undefined function: mysql_connect() in
/var/www/html/index.php on line 3.

I have the following RPMS installed on RH7.2
MySQL-client-4.0.14-0 I would really appreciate it.
MySQL-shared-4.0.14-0
MySQL-server-4.0.14-0
MySQL-devel-4.0.14-0
php-imap-4.0.6-7
php-4.0.6-7
apache-1.3.20-16
apache-devel-1.3.20-16
apacheconf-0.8.1-1

The code i am trying to run is: I would really appreciate it.
<?php
printf("opening db.....");
$db = mysql_connect("localhost","user","password");
printf("closing db\n");
mysql_close($db);
?>

The configure part of phpinfo() shows:
-----
'./configure'
'i386-redhat-linux' '--prefix=/usr' .<snip>
'--enable-wddx' '--without-mysql' '--without-unixODBC'
'--without-oracle' '--without-oci8' '--with-pspell' '--with-xml'
------

I believe the mysql is not installed to work along with PHP. I
installed php using rpm.
My question is how do i make it work. I have checked NG and tested all
the options. But to no avail.

I also tried by uncommenting the line extensin=mysql.so in
/etc/php.ini.

Can somebody please help. Is there any other information you require?
I would really appreciate it.

TIA
-BT


Jul 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.