Call to undefined function: mysql_connect()

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
tkouan
Posts: 3
Joined: Mon Nov 28, 2005 10:29 pm

Call to undefined function: mysql_connect()

Post by tkouan »

Much like everyone else I too get the error below when I php poller.php:

PHP Fatal error: Call to undefined function: mysql_connect() in /home/apoc/public_html/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 338



[Php Info]
>>php -i |grep mysql
Configure Command => './configure' '--with-apxs=/usr/local/apache/bin/apxs' '--with-gd' '--with-xml' '--with-bcmath' '--enable-calendar' '--enable-ftp' '--enable-magic-quotes' '--with-mysql' '--enable-discard-path' '--with-pear' '--enable-sockets' '--enable-track-vars' '--enable-versioning' '--with-zlib' '--with-jpeg-dir=/usr/lib'
mysql
...

More configs for mysql

>>php -m
[PHP Modules]
calendar
ctype
ftp
gd
mysql
overload
pcre
posix
session
sockets
standard
tokenizer
xml
zlib

[Zend Modules]
Apache version 1.3.33 (Unix)
PHP version 4.3.10
MySQL version 4.0.25-standard


I currently use:
mysql_connect(localhost,$username,$password);

In many parts of my server at it works fine. All the rest of Cacti works fine. Even have blank graphs.


Any help?
stickboy2642
Posts: 2
Joined: Wed Nov 30, 2005 12:04 pm

Post by stickboy2642 »

You have to build in mysql support in PHP. Add --with-mysql=/usr/local/mysql when you build PHP, and it will build in the mysql support.
tkouan
Posts: 3
Joined: Mon Nov 28, 2005 10:29 pm

Post by tkouan »

Stickyboy -


As you can see in the config line that I included in my original post, php was built with the tag that you suggested.
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

Maybe you have two php binaries in your system and Cacti is configured to use the second one and it does not have mysql build-in?

- Piotr
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests