473,396 Members | 1,998 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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
1 9951
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: gc | last post by:
I'm a PHP and MySQL newbie. I have a feeling a lot of you may have seen this before. I'm teaching myself PHP/MySQL and trying to setup a guestbook. I'm running latest versions of Apache, PHP and...
1
by: Mike | last post by:
Last weekend I decided to install Apache 2.0.53-win32-x86-no_ssl PHP 5.0.3 Smarty 2.6.7 MySQL essential-4.1.10-win32 I have Apache up (Port 80 blocked at the router and firewall!) and I have...
2
by: inonzuk | last post by:
why strange you ask? here goes: I have been working with Php and Mysql for a week without any problems. Today I tried executing a php page that connects to mysql and creates a new database, I...
2
by: Frobinrobin | last post by:
I am running Win2k3 Server and when I try to use the mysql_connect function I am getting an error: Fatal error: Call to undefined function mysql_connect() in...
4
by: MJ | last post by:
I am using the following script to connect but keep getting <?php $conn = mysql_connect("", "mjohn", ""); mysql_select_db("testDB",$conn); ?> but keep getting this error Fatal error: Call to...
5
by: ligerdave | last post by:
i run php4+mysql+apache2 on linux(ubuntu). every time i try to use mysql_connect function, it says something like this: Fatal error: Call to undefined function: mysql_connect() in...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
5
by: awdsites | last post by:
Hi, I'm a noob with a server so keep that in mind :) Been trying to connect with php to mysql and all I get is: "Fatal error: Call to undefined function: mysql_connect()" I've read and read...
1
by: mwailes | last post by:
Hello, I have been running PHP 5, MySQL 5.0 and Apache 2.0 on a XP machine. I was working on a project and I was getting a lot of "undefined index" notices so I went into my php.ini file to turn...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.