LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 12-04-2006, 02:50 PM   #1
Shioni
Member
 
Registered: Mar 2006
Posts: 182

Rep: Reputation: 30
weird PHP problem: Call to undefined function mysql_connect()


Hi!
I installed apache 2.2.3 and PHP 5.2.0. The PHP at first didn't work, so I configured httpd.conf and it still didn't work!

The weirdest thing, is when I removed php.ini from /etc/apache2/
PHP started to work. When I put it back, it doesn't and I get completely no output on Firefox and Konqueror, even not the source code, but when I view pages source, then I can see my PHP.

Another weird thing is when I try to connect to mysql, I get:
Code:
Call to undefined function mysql_connect()
but in phpinfo(); I got:
Code:
'--with-mysql=shared,/usr' '--with-mysqli=shared' '--with-ncurses' '--with-unixODBC=shared,/usr' '--enable-pcntl' '--with-pdo-firebird=shared' '--with-pdo-mysql=shared'
but there is no more output about mysql. I guess it means, it was compiled, without mysql support.. or am I missing something? Thank you!
 
Old 12-21-2006, 04:46 AM   #2
sheryco
Member
 
Registered: Feb 2003
Location: FTWorth, TX
Distribution: Gentoo, Debian, CentOS, FreeBSD, NetBSD & OpenBSD
Posts: 55

Rep: Reputation: 15
What is your output of php modules
Quote:
#php -m
or you can check if you install it via source and see if it was installed with mysql
Quote:
#php -i | egrep configure
Or if you have one of those OS's with package installers check if you have php-mysql package is installed.
 
Old 12-21-2006, 08:46 AM   #3
nnadithya
LQ Newbie
 
Registered: Dec 2006
Location: Bangalore
Distribution: Fedora Core 6
Posts: 17

Rep: Reputation: 0
hi

this is the default syntax mysql_connect("hostname","root","");

the last part is your root password for mysql if not set just use as given above mostly this is your problem

bye
 
Old 12-21-2006, 08:23 PM   #4
Shioni
Member
 
Registered: Mar 2006
Posts: 182

Original Poster
Rep: Reputation: 30
Thanks! OK, I compiled from source and everything now works!
Quote:
Originally Posted by nnadithya
hi

this is the default syntax mysql_connect("hostname","root","");

the last part is your root password for mysql if not set just use as given above mostly this is your problem

bye
Actualy then PHP would give me error message about arguments, and I'm sure that it wasn't syntax fault..
 
Old 12-22-2006, 05:26 AM   #5
nnadithya
LQ Newbie
 
Registered: Dec 2006
Location: Bangalore
Distribution: Fedora Core 6
Posts: 17

Rep: Reputation: 0
i actually encountered the same problem some time back and it was because i missed the password field and for my surprise there was no syntax error message but said
Call to undefined function mysql_connect()

ok any way urs may be not that case
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
PHP Call to undefined function imagettfbbox() QtCoder Programming 24 01-18-2012 12:20 PM
I need help on this PHP error -- "Call to undefined function: mysql_connect()" yzh999 Linux - Software 1 08-12-2006 03:14 AM
Call to undefined function: mysql_connect() SocialEngineer Linux - Software 2 11-16-2004 02:24 PM
Call to undefined function: mail() in PHP pembo13 Fedora 0 07-28-2004 07:40 PM
PHP: Call to undefined function: session_start() wellmt Linux - Newbie 2 06-01-2004 05:50 AM


All times are GMT -5. The time now is 03:08 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration