LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 03-02-2006, 07:31 AM   #1
Fasn8n
Member
 
Registered: Dec 2004
Location: Virginia
Posts: 79

Rep: Reputation: 15
MySQL doesn't work with my PHP :-(


I know my PHP works fine... Tested.
I know MySQL works fine... Tested.

But they don't work together. I'm using PHP5. I opened a phpinfo() and it shows under supported databases, MySQL.


My problem came here with this error...
"Call to undefined function mysql_connect()"

Should work, right? I'm trying to take a website I already created on another machine and put on mine. I already dumped the DB and put it on, copied all the files over, most files work but not the ones that require MySQL. Any help?
 
Old 03-02-2006, 08:11 AM   #2
tangle
Senior Member
 
Registered: Apr 2002
Location: Arbovale, WV
Distribution: Slackware
Posts: 1,761

Rep: Reputation: 78
Did you set the permissions on the database?
 
Old 03-02-2006, 08:49 AM   #3
this213
Member
 
Registered: Dec 2001
Location: ./
Distribution: Fedora, CentOS, RHEL, Gentoo
Posts: 167

Rep: Reputation: 34
The entry under "Supported Databases" doesn't give it to you oddly enough. In your phpinfo() page, you should see a complete section for "mysql" showing module type, API version, socket, include path and libraries among other things. If you don't see this, you don't have mysql support. If you see "Call to undefined function mysql_connect()" you definitely don't have mysql support.

Use whatever package manager you're comfortable with to install the php-mysql package. The package might also be called php4-mysql or php5-mysql depending on your version of php and how Ubuntu decides to name their packages (I don't use Ubuntu so I couldn't say exactly)
 
Old 03-02-2006, 01:33 PM   #4
Fasn8n
Member
 
Registered: Dec 2004
Location: Virginia
Posts: 79

Original Poster
Rep: Reputation: 15
Okay well I didnt have php5-mysql installed but now I do... Still nothing.
 
Old 03-02-2006, 01:36 PM   #5
this213
Member
 
Registered: Dec 2001
Location: ./
Distribution: Fedora, CentOS, RHEL, Gentoo
Posts: 167

Rep: Reputation: 34
did you restart the web server then check phpinfo again?
 
Old 03-02-2006, 01:45 PM   #6
Fasn8n
Member
 
Registered: Dec 2004
Location: Virginia
Posts: 79

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by this213
did you restart the web server then check phpinfo again?
Awesome... you rock dude! I didnt know I had to restart even when I'm running it from my own machine. Thanks, all better now
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Trying to get PHP to work with MySQL walterbyrd Linux - Software 1 03-25-2005 10:58 AM
mysql doesn't work with php ivanatora Linux - Software 0 02-26-2004 02:28 PM
Apache Mysql Php: mysql with php doesn't work breakerfall Linux - Networking 6 12-27-2003 08:59 PM
Just wanting MySQL to work with php edhan Linux - Newbie 5 09-13-2003 03:48 AM
getting mysql to work with php dsgdevil Linux - General 8 02-09-2003 09:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 10:18 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration