Connecting Tech Pros Worldwide Help | Site Map

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

BT
Guest
 
Posts: n/a
#1: Jul 17 '05
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
John Smith
Guest
 
Posts: n/a
#2: Jul 17 '05

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


You forgot to install the php-mysql RPM

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


Grant

BT wrote:[color=blue]
> 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[/color]

Closed Thread