PHP and MySQL

  • Paul
  • Newbie
  • Newbie
  • Paul
  • Posts: 9

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Can you paste the exact code you are using around line 9 so we can see how you are calling. Thanks.
  • Paul
  • Newbie
  • Newbie
  • Paul
  • Posts: 9

Post 3+ Months Ago

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
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

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

rpm -qa | grep php
  • Paul
  • Newbie
  • Newbie
  • Paul
  • Posts: 9

Post 3+ Months Ago

php-ldap-4.2.2-17
php-imap-4.2.2-17
php-4.2.2-17
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Make sure you have the

php-mysql

rpm installed
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

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.
  • Paul
  • Newbie
  • Newbie
  • Paul
  • Posts: 9

Post 3+ Months Ago

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
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

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?
  • Paul
  • Newbie
  • Newbie
  • Paul
  • Posts: 9

Post 3+ Months Ago

The hosting company installed Redhat, and apache. I had to do the rest.
  • Bigwebmaster
  • Site Admin
  • Site Admin
  • User avatar
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

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.
  • Paul
  • Newbie
  • Newbie
  • Paul
  • Posts: 9

Post 3+ Months Ago

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
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

See if you can find the rpm for libmysqlclient then from rpmfind.net.. you have to have all the dependencies.
  • Paul
  • Newbie
  • Newbie
  • Paul
  • Posts: 9

Post 3+ Months Ago

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
  • Posts: 9089
  • Loc: Seattle, WA & Phoenix, AZ

Post 3+ Months Ago

Glad to see you resolved your problems :D
  • Willy
  • Graduate
  • Graduate
  • Willy
  • Posts: 199

Post 3+ Months Ago

my mysql isn't connecting, i have exaclty the same problems as that guy had.... Only problem is (and i'm new with the whole rpming of things)

when i search for "libmysqlclient.so.10 " on rpmfind
i get --> mysql-3.23.56-1.80.i386.rpm

when i rpm that it requires
-- > perl-DBD-MySQL

when i try and rpm that it requires --> libmysqlclient.so.10

i've been going in circles with this problem for weeks now
  • Gav
  • Born
  • Born
  • Gav
  • Posts: 1

Post 3+ Months Ago

I have exactly the same symptoms as Paul on a new redhat 9 install. But in my case I do have php-mysql thing installed - I checked with the rpm thing and the list included php-mysql-4.2.2-17

But I still get the "Fatal error: Call to undefined function: mysql_pconnect() " ???

any ideas appreciated,

cheers, Gav
  • Willy
  • Graduate
  • Graduate
  • Willy
  • Posts: 199

Post 3+ Months Ago

Ok, i'm un-rpming my mysql ... i'm planning to re-rpm it, is it possible that i may want to try an older version so that i can HOPEFULLY have luck with the php-mysql (updater) file???

Post Information

  • Total Posts in this topic: 18 posts
  • Users browsing this forum: No registered users and 15 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.