PHP and MySQL

  • Paul
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jun 09, 2003
  • Posts: 9
  • Status: Offline

Post June 9th, 2003, 7:18 pm

My server:
Redhat Linux 9.0
Apache 2.0.40
MySQL 4.0.13
PHP 4.2.2

My problem:
When I make a simple php page, (such as just phpinfo();) everything works fine. So I am assuming that php is working fine.
Then I go to connect to my database using mysql_connect() and I recieve and error
Fatal error: Call to undefined function: mysql_connect() in /var/www/infotest.php on line 9

I've tried everything, I can think of to try and make this work. Including re-installing MySQL and PHP.

Please help if you can.
Thanks
Paul
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 9th, 2003, 7:18 pm

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post June 9th, 2003, 8:10 pm

Can you paste the exact code you are using around line 9 so we can see how you are calling. Thanks.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Paul
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jun 09, 2003
  • Posts: 9
  • Status: Offline

Post June 9th, 2003, 8:18 pm

Code: [ Select ]
mysql_connect('localhost', 'username', 'password') or die("Did not connect!");
mysql_select_db('databasename') or die("Did not select database");
  1. mysql_connect('localhost', 'username', 'password') or die("Did not connect!");
  2. mysql_select_db('databasename') or die("Did not select database");
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post June 9th, 2003, 8:20 pm

Okay, try typing this from your shell and tell me your results

rpm -qa | grep php
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Paul
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jun 09, 2003
  • Posts: 9
  • Status: Offline

Post June 9th, 2003, 8:24 pm

php-ldap-4.2.2-17
php-imap-4.2.2-17
php-4.2.2-17
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post June 9th, 2003, 8:34 pm

Make sure you have the

php-mysql

rpm installed
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post June 9th, 2003, 8:35 pm

On my server it is:

php-mysql-4.2.2

I am not sure what the latest version is, but it doesn't seem like you have it installed.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Paul
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jun 09, 2003
  • Posts: 9
  • Status: Offline

Post June 9th, 2003, 8:37 pm

Is that a whole seperate rpm, or part of something you set up when you intall the php rpm? If it is a seperate rpm, do you have a link on where I can find it?
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post June 9th, 2003, 8:38 pm

Its a seperate RPM. When you install redhat, just make sure that package is selected. Did you install Redhat or is that how your server came?
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Paul
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jun 09, 2003
  • Posts: 9
  • Status: Offline

Post June 9th, 2003, 8:40 pm

The hosting company installed Redhat, and apache. I had to do the rest.
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post June 9th, 2003, 8:45 pm

Okay you can get the RPM from rpmfind.net

Here is the link to the redhat 9 version of the rpm

ftp://ftp.rpmfind.net/linux/redhat/9/en ... 7.i386.rpm

At rpmfind.net you can basically type in whatever RPM you are looking for and you will find it. Anyway once you install that let me know if things work for you.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Paul
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jun 09, 2003
  • Posts: 9
  • Status: Offline

Post June 9th, 2003, 8:53 pm

I recieved this error

error: Failed dependencies:
libmysqlclient.so.10 is needed by php-mysql-4.2.2-17

should I try installing ignoring dependancies or should I try something else?
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post June 9th, 2003, 9:35 pm

See if you can find the rpm for libmysqlclient then from rpmfind.net.. you have to have all the dependencies.
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Paul
  • Newbie
  • Newbie
  • No Avatar
  • Joined: Jun 09, 2003
  • Posts: 9
  • Status: Offline

Post June 9th, 2003, 9:49 pm

I do believe I have it. Thank you very much, you are my hero. You are the Bigwebmaster Supreme
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 8922
  • Loc: Seattle, WA & Phoenix, AZ
  • Status: Offline

Post June 9th, 2003, 10:17 pm

Glad to see you resolved your problems :D
Ozzu Hosting - Want your website on a fast server like Ozzu?
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 9th, 2003, 10:17 pm

Post Information

  • Total Posts in this topic: 18 posts
  • Users browsing this forum: No registered users and 43 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.