473,375 Members | 1,298 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,375 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 9947
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.