Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
04-15-2008, 11:18 AM
|
#1
|
Member
Registered: Jan 2007
Location: INDIA
Distribution: Ubuntu, Debian
Posts: 343
Rep:
|
PHP not supporting mysql_connect()
I have installed debian etch and apache
later downloaded and installed mysql and it is working
PHP is also working
but when i write code to connect to the mysql
i.e $conn=mysql_connect("localhost","root","")
Fatal error: Call to undefined function: mysql_connect() in /var/www/apache2-default/sal.php on line 8
where is the problem?
is it with apache? mysql? PHP?
is is required to apache get compiled after the installation of mysql
to support mysql libraries?
the mysql is a binary (tgz) version (not source code) which i installed
|
|
|
04-15-2008, 01:28 PM
|
#2
|
Member
Registered: Jun 2003
Location: SoCal
Distribution: CentOS
Posts: 465
Rep:
|
Have you installed the php-mysql package? Try running:
Code:
aptitude install php-mysql
as root at the command line.
I'm not a debian user so if that doesn't work try agt-get instead of aptitude.
Cheers!
|
|
|
04-16-2008, 10:21 AM
|
#3
|
Member
Registered: Jan 2007
Location: INDIA
Distribution: Ubuntu, Debian
Posts: 343
Original Poster
Rep:
|
I don't like to lean towards a particular distro
that is why i installed downloaded mysql from tar binary though it is possible to install it from the installation cd. I would like to do things in a standardised way - i.e The solutions should be applicable to every distro (for example getting packages in tar form is acceptable to all distros also compiling them is acceptable to all systems)
How ever I understand that for my problem, the package mysql_php should be installed. I shall try that way
But why it is required? What is its function?
|
|
|
04-16-2008, 11:15 AM
|
#4
|
Member
Registered: Jun 2003
Location: SoCal
Distribution: CentOS
Posts: 465
Rep:
|
Quote:
The php-mysql package contains a dynamic shared object that will add
MySQL database support to PHP.
|
- http://rpmfind.net//linux/RPM/fedora....5-6.i386.html
Cheers!
|
|
|
04-16-2008, 09:48 PM
|
#5
|
LQ Newbie
Registered: Feb 2008
Location: Massachusetts
Distribution: Debian Linux and FreeBSD
Posts: 12
Rep:
|
How did you install the PHP? Did it get compiled with mysql support? If you're using Debian, generally you apt-get php5-common, then install php5-mysql. It's not enabled by default (I don't think anyhow).
If you didn't install php from a package manager, you may need to enable it in the php source during the configure stage (although I thought this was now enabled by default).
Since there are so many extensions available for PHP, they only enable certain ones by default, and you enable/disable the ones you need.
|
|
|
04-17-2008, 12:22 PM
|
#6
|
Member
Registered: Jan 2007
Location: INDIA
Distribution: Ubuntu, Debian
Posts: 343
Original Poster
Rep:
|
Yes : the posting done by eaglek96 is close to my doubt
During configurations set up, we have to enable it.
My doubt is that much enough?
Is there anything I have to do with apache (means recompilation)
What is the order of installation
Apache, Mysql, php?
|
|
|
All times are GMT -5. The time now is 10:45 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|