By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,521 Members | 1,492 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.

mysql_connect Error

P: n/a
Hi,

I am new to php and I'm testing php connectivity to mysql. I created a
php script using the php.net sample. The script uses the mysql_connect
method and when I execute it I get the error:

Fatal error: Call to undefined function: mysql_connect() in
/var/www/html/testPHP/testMysql.php on line 7

I have mysqld ver 4.0.20 and php 4.2.2 that came bundled with apache
(that came bundled with RH9).

Thanks for the help,

-Rex
Jul 17 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
>I am new to php and I'm testing php connectivity to mysql. I created a
php script using the php.net sample. The script uses the mysql_connect
method and when I execute it I get the error:

Fatal error: Call to undefined function: mysql_connect() in
/var/www/html/testPHP/testMysql.php on line 7

I have mysqld ver 4.0.20 and php 4.2.2 that came bundled with apache
(that came bundled with RH9).


Not all configurations of PHP support Oracle. Or Postgresql. Or
MySQL. It looks like your version doesn't. Check the output of
phpinfo() to see how your PHP is configured. You may need to build
the configuration you need or find a binary distribution that has
what you need already configured in.

Gordon L. Burditt
Jul 17 '05 #2

P: n/a
"Frogman" <rf*@rocketmail.com> wrote in message
news:d7**************************@posting.google.c om...
Hi,

I am new to php and I'm testing php connectivity to mysql. I created a
php script using the php.net sample. The script uses the mysql_connect
method and when I execute it I get the error:

Fatal error: Call to undefined function: mysql_connect() in
/var/www/html/testPHP/testMysql.php on line 7

I have mysqld ver 4.0.20 and php 4.2.2 that came bundled with apache
(that came bundled with RH9).


I had that configuration at one time. There is an RPM (or 2) you need to
download and install from RedHat that provides the MySQL connectivity. I
don't remember what it was.

I eventually wanted to upgrade my PHP to get the newer GD functions. Sad to
discover that getting PHP upgraded via the RPM route was like pulling teeth.
Too many dependencies from where you are now. I finally just installed
Fedora Core 1 and it resolved all my issues. Then, I noticed that the Update
mechanism in Fedora Core 1 indicated that a newer version of PHP was
available and I ran the update. It went smoothly.

- Virgil
Jul 17 '05 #3

P: n/a
Yes you're absolutely right. I tried upgrading my PHP with the latest
RPM and the dependencies goes on and on. I'm planning on just
installing Fed core 2 on my RH9 install.

Did you install Fedora on top of RH?

-Ray

"Virgil Green" <vj*@DESPAMobsydian.com> wrote in message news:<4C*****************@newssvr23.news.prodigy.c om>...
"Frogman" <rf*@rocketmail.com> wrote in message
news:d7**************************@posting.google.c om...
Hi,

I am new to php and I'm testing php connectivity to mysql. I created a
php script using the php.net sample. The script uses the mysql_connect
method and when I execute it I get the error:

Fatal error: Call to undefined function: mysql_connect() in
/var/www/html/testPHP/testMysql.php on line 7

I have mysqld ver 4.0.20 and php 4.2.2 that came bundled with apache
(that came bundled with RH9).


I had that configuration at one time. There is an RPM (or 2) you need to
download and install from RedHat that provides the MySQL connectivity. I
don't remember what it was.

I eventually wanted to upgrade my PHP to get the newer GD functions. Sad to
discover that getting PHP upgraded via the RPM route was like pulling teeth.
Too many dependencies from where you are now. I finally just installed
Fedora Core 1 and it resolved all my issues. Then, I noticed that the Update
mechanism in Fedora Core 1 indicated that a newer version of PHP was
available and I ran the update. It went smoothly.

- Virgil

Jul 17 '05 #4

P: n/a
On 25 Jun 2004 09:02:38 -0700, rf*@rocketmail.com (Frogman) wrote:
Yes you're absolutely right. I tried upgrading my PHP with the latest
RPM and the dependencies goes on and on. I'm planning on just
installing Fed core 2 on my RH9 install.
If you don't mind taking the extra time, you should compile everything
you want to use (apache, php, mysql, ssl etc) from the source.

It's worth it. Especially at upgrade time.
Did you install Fedora on top of RH?

That'd be a bad idea. Security issues alone make a fresh install the
best install.
Oh, and could you please not top post? Thx. :)
--
gburnore@databasix dot com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ۳ݳ޳ݳۺݳ޳ݳݳ޳ݳ۳
| ۳ݳ޳ݳۺݳ޳ݳݳ޳ݳ۳
DataBasix | ۳ݳ޳ݳۺݳ޳ݳݳ޳ݳ۳
| ۳ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ۳
Black Helicopter Repair Svcs Division | Official Proof of Purchase
================================================== =========================
Want one? GET one! http://www.databasix.com
================================================== =========================
Jul 17 '05 #5

P: n/a

"Frogman" <rf*@rocketmail.com> wrote in message
news:d7************************@posting.google.com ...
"Virgil Green" <vj*@DESPAMobsydian.com> wrote in message

news:<4C*****************@newssvr23.news.prodigy.c om>...
"Frogman" <rf*@rocketmail.com> wrote in message
news:d7**************************@posting.google.c om...
Hi,

I am new to php and I'm testing php connectivity to mysql. I created a
php script using the php.net sample. The script uses the mysql_connect
method and when I execute it I get the error:

Fatal error: Call to undefined function: mysql_connect() in
/var/www/html/testPHP/testMysql.php on line 7

I have mysqld ver 4.0.20 and php 4.2.2 that came bundled with apache
(that came bundled with RH9).


I had that configuration at one time. There is an RPM (or 2) you need to
download and install from RedHat that provides the MySQL connectivity. I
don't remember what it was.

I eventually wanted to upgrade my PHP to get the newer GD functions. Sad to discover that getting PHP upgraded via the RPM route was like pulling teeth. Too many dependencies from where you are now. I finally just installed
Fedora Core 1 and it resolved all my issues. Then, I noticed that the Update mechanism in Fedora Core 1 indicated that a newer version of PHP was
available and I ran the update. It went smoothly.

- Virgil

Yes you're absolutely right. I tried upgrading my PHP with the latest
RPM and the dependencies goes on and on. I'm planning on just
installing Fed core 2 on my RH9 install.

Did you install Fedora on top of RH?

-Ray


As I recall, I did indeed install Fedora 1 over RH9. It's my local box and
is only for playing, so I just took the quickest route. I had other things
to do at the moment.

- Virgil

Jul 17 '05 #6

P: n/a
Sorry but I'm not sure what you mean by 'top post'. Can you explain. Thanks.

Gary L. Burnore <gb******@databasix.com> wrote in message news:<cb**********@blackhelicopter.databasix.com>. ..
On 25 Jun 2004 09:02:38 -0700, rf*@rocketmail.com (Frogman) wrote:
Yes you're absolutely right. I tried upgrading my PHP with the latest
RPM and the dependencies goes on and on. I'm planning on just
installing Fed core 2 on my RH9 install.


If you don't mind taking the extra time, you should compile everything
you want to use (apache, php, mysql, ssl etc) from the source.

It's worth it. Especially at upgrade time.
Did you install Fedora on top of RH?

That'd be a bad idea. Security issues alone make a fresh install the
best install.
Oh, and could you please not top post? Thx. :)
--
gburnore@databasix dot com
---------------------------------------------------------------------------
How you look depends on where you go.
---------------------------------------------------------------------------
Gary L. Burnore | ۳ݳ޳ݳۺݳ޳ݳݳ޳ݳ۳
| ۳ݳ޳ݳۺݳ޳ݳݳ޳ݳ۳
DataBasix | ۳ݳ޳ݳۺݳ޳ݳݳ޳ݳ۳
| ۳ 3 4 1 4 2 ݳ޳ 6 9 0 6 9 ۳
Black Helicopter Repair Svcs Division | Official Proof of Purchase
================================================== =========================
Want one? GET one! http://www.databasix.com
================================================== =========================

Jul 17 '05 #7

P: n/a
In article <d7**************************@posting.google.com >, Frogman wrote:
Sorry but I'm not sure what you mean by 'top post'. Can you explain. Thanks.


So i did a little websearch.... typed in "top post" at
http://www.google.com *bam* got the answer.
--
Tim Van Wassenhove <http://home.mysth.be/~timvw>
Jul 17 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.