LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-09-2009, 04:58 AM   #1
methoxcy
Member
 
Registered: Dec 2007
Posts: 48

Rep: Reputation: 16
PHP problem


I have an error encountered in my PHP it seems that i need to install PHP with mysql support. I have an existing PHP5 and Mysql and i dont know if my mysql have a support. how can i do that php5 w/ mysql support?? can anyone teach me the step by step im only newbie and i dont have any idea whats going on but i really need this.. Could anyone help me bout my problem?..tnx a lot
 
Old 02-09-2009, 05:00 AM   #2
rsciw
Member
 
Registered: Jan 2009
Location: Essex (UK)
Distribution: Home: Debian/Ubuntu, Work: Ubuntu
Posts: 206

Rep: Reputation: 44
what does the output of

<?php
phpinfo();
?>

say regarding mysql?
 
Old 02-09-2009, 05:05 AM   #3
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
Usually php has mysql support by default. You could look in /etc/php.ini and
/etc/php.d/mysql.ini for more info.
Also phpinfo function will give you the required information.
 
Old 02-09-2009, 05:07 AM   #4
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
Not always, my server had MySQL and PHP but lacked the php-mysql module and thus PHP failed to communicate with MySQL

Distribution would also help to know. I'd suggest a missing MySQL module for PHP, which is very very easy to fix with a package manager.

Last edited by r3sistance; 02-09-2009 at 05:08 AM.
 
Old 02-09-2009, 05:07 AM   #5
General Failure
Member
 
Registered: Jan 2007
Location: Germany
Distribution: Slackware 13.37
Posts: 387

Rep: Reputation: 37
Did you check that mysql is running? Running
Code:
ps aux | grep mysql
will show you if mysql is running. If the commands give no output, it isn't, so you'd have to make it start automatically on boot. Besides, it is necessary to setup mysql before using it (create tables/users...). Just refer to your distro's documentation to see how to do that, these are standard tasks that I assume will be documented there.
 
Old 02-09-2009, 11:53 AM   #6
selva146
Member
 
Registered: Oct 2007
Location: INDIA
Distribution: Rehat, Fedora, RHEL
Posts: 47

Rep: Reputation: 15
if it is redhat or fedora, u can use rpm to check whether php-mysql module is installed.

rpm -q php-mysql
 
Old 02-09-2009, 07:02 PM   #7
methoxcy
Member
 
Registered: Dec 2007
Posts: 48

Original Poster
Rep: Reputation: 16
PHP error.

YOYO123Fullname:
Fatal error: Call to undefined function mysql_connect() in /var/www/html/GetTime2.php on line 63

this is the I saw in my php info... what should i do??
 
Old 02-09-2009, 11:39 PM   #8
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
Look at line 63. What does it say? Without the code no one here can tell you what went wrong with your code.
Also post the contents of file /etc/php.d/mysql.ini
 
Old 02-10-2009, 04:47 AM   #9
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
Quote:
Originally Posted by linuxlover.chaitanya View Post
Without the code no one here can tell you what went wrong with your code.
Apart from it says "undefined function" what is a good indicator that PHP does not understand the function. He needs to install the php-mysql module, however until we know what distribution it is, can not tell him the easiest method to do it.
 
Old 02-10-2009, 05:26 AM   #10
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
Thats why the contents of the file that I said. If it has got the php-mysql module installed it will have the extension=mysql.so or something there.

If the distro is Debian based or Ubuntu like
sudo apt-get install php-mysql should do it.

If it is something else Fedora or RH or CentOS
yum install php-mysql should do it.

Or else find the binary package if available and install.
 
  


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
Urgent PHP problem with "undefined function: domxml_open_mem()"! Recomplie php? Oskare100 Linux - Server 0 12-27-2006 12:28 PM
php comment problem // and /* on Fedora Core 5 and PHP 5.1.4 shakeel_125 Linux - Server 4 09-29-2006 04:42 AM
php comment problem // and /* on Fedora Core 5 and PHP 5.1.4 shakeel_125 Fedora 4 09-29-2006 02:14 AM
New to PHP and Postgressql. Is this a PHP problem or a sql problem. Please help sendas4 Linux - General 2 11-05-2004 01:54 PM
Apache php index.php problem neurotic Linux - Software 3 11-18-2003 06:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:39 PM.

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