Fatal error</b>: Call to undefined function: mysql_p

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

Moderators: Developers, Moderators

Post Reply
anjancd
Posts: 6
Joined: Wed May 09, 2007 12:06 pm

Fatal error</b>: Call to undefined function: mysql_p

Post by anjancd »

Hi,

This is my first cacti install. I read a bunch of posts about this issue, but i still can't figure out the issue, hence one more post on this topic...

This is RHEL4, 2.6 64-bit.

MySQL RPMs were installed -
passel:rpm -qa | grep My
MySQL-devel-standard-5.0.27-0.rhel3
MySQL-server-standard-5.0.27-0.rhel3
MySQL-shared-standard-5.0.27-0.rhel3
MySQL-shared-compat-5.0.27-0.rhel3
MySQL-client-standard-5.0.27-0.rhel3

PHP 5.2.0 and Apache 2.0.59 were compiled, with the --mysql option. Following is the section from php.ini file:
==============================
[MySQL]
; Allow or prevent persistent links.
mysql.allow_persistent = On

; Maximum number of persistent links. -1 means no limit.
mysql.max_persistent = -1

; Maximum number of links (persistent + non-persistent). -1 means no limit.
mysql.max_links = -1

; Default port number for mysql_connect(). If unset, mysql_connect() will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
; at MYSQL_PORT.
mysql.default_port =

; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysql.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
mysql.default_host = passel

; Default user for mysql_connect() (doesn't apply in safe mode).
mysql.default_user =

; Default password for mysql_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
; and reveal this password! And of course, any users with read access to this
; file will be able to reveal the password as well.
mysql.default_password =

; Maximum time (in seconds) for connect timeout. -1 means no limit
mysql.connect_timeout = 60

; Trace mode. When trace_mode is active (=On), warnings for table/index scans an
d
; SQL-Errors will be displayed.
mysql.trace_mode = Off

==========================================

When i click on the Cacti icon, it says, "PHP SNMP Support: no"

When i do "php poller.php", i get following:
=============================
hostname:php cacti/poller.php
PHP Fatal error: Call to undefined function: mysql_pconnect() in /export/home/cacti/lib/adodb/drivers/adodb-mysql.inc.php on line 356
Content-type: text/html
X-Powered-By: PHP/4.3.9


I made sure that Cacti is pointing to /export/home/php installation rather than /usr/bin/php. I also thought that Cacti is using the default /etc/php.ini file, so i replaced it with a link to the new /export/home/php/php.ini file. After doing that, i get this message:
===============================================
hostname:php cacti/poller.php
PHP Warning: Unknown(): Unable to load dynamic library './ldap.so' - ./ldap.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library './odbc.so' - ./odbc.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: Unknown(): Unable to load dynamic library './pgsql.so' - ./pgsql.so: cannot open shared object file: No such file or directory in Unknown on line 0
Content-type: text/html
X-Powered-By: PHP/4.3.9

<br />
<b>Fatal error</b>: Call to undefined function: mysql_pconnect() in <b>/export/home/cacti/lib/adodb/drivers/adodb-mysql.inc.php</b> on line <b>356</b><br />


My phpinfo() test shows following under the MySQL section:
======================================
[img]
mysql
MySQL Support enabled
Active Persistent Links 0
Active Links 0
Client API version 5.0.27
MYSQL_MODULE_TYPE external
MYSQL_SOCKET /var/lib/mysql/mysql.sock
MYSQL_INCLUDE -I/usr/local/lib/mysql/include
MYSQL_LIBS -L/usr/local/lib/mysql/lib -lmysqlclient

Directive Local Value Master Value
mysql.allow_persistent On On
mysql.connect_timeout 60 60
mysql.default_host passel passel
mysql.default_password no value no value
mysql.default_port no value no value
mysql.default_socket no value no value
mysql.default_user no value no value
mysql.max_links Unlimited Unlimited
mysql.max_persistent Unlimited Unlimited
mysql.trace_mode Off Off

[/img]

Any idea what i can try next?

Thanks,
acd
anjancd
Posts: 6
Joined: Wed May 09, 2007 12:06 pm

Post by anjancd »

Changed the php binary to point to the correct one, and now i get this -

hostname:ls -l /usr/bin/php
lrwxrwxrwx 1 root root 30 May 10 09:33 /usr/bin/php -> /export/home/php-5.2.0/bin/php

hostname:php poller.php
sh: /export/home/php-5.2.0/bin: is a directory
sh: /export/home/rrdtool: is a directory

^c

I'd appreciate any help!

Thanks,
acd
anjancd
Posts: 6
Joined: Wed May 09, 2007 12:06 pm

Post by anjancd »

Ok, i dropped the Cacti database and recreated it, following the instructions. I don't get an error now, however, i STILL DON'T see any graphs...

hostname:php poller.php
OK u:0.01 s:0.01 r:0.01
OK u:0.01 s:0.01 r:0.01
OK u:0.01 s:0.01 r:0.01
OK u:0.01 s:0.02 r:0.01
OK u:0.01 s:0.02 r:0.01
OK u:0.01 s:0.02 r:0.02
OK u:0.01 s:0.02 r:0.02
OK u:0.01 s:0.02 r:0.03
OK u:0.01 s:0.02 r:0.03
OK u:0.01 s:0.02 r:0.04
OK u:0.01 s:0.02 r:0.04
OK u:0.01 s:0.02 r:0.05
OK u:0.01 s:0.02 r:0.05
05/10/2007 02:56:14 PM - SYSTEM STATS: Time:1.3557 Method:cmd.php Processes:1 Threads:N/A Hosts:3 HostsPerProcess:3 DataSources:13 RRDsProcessed:9

The data query seems to work fine...


--ACD
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please post a screenshot
Reinhard
anjancd
Posts: 6
Joined: Wed May 09, 2007 12:06 pm

Post by anjancd »

I have attached a picture.
Attachments
cacti.JPG
cacti.JPG (114.29 KiB) Viewed 2630 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please verify, that "rrdtool -v" output reflects the same version as "Settings -> RRDTool Utility Version"
Reinhard
anjancd
Posts: 6
Joined: Wed May 09, 2007 12:06 pm

Post by anjancd »

Thanks, gandalf. I can see the graphs now, however they don't have any data populated within...i have attached the graph.

I do see some old files under the ../rra directory:

-rw-r--r-- 1 root root 141640 May 10 14:56 localhost_load_1min_5.rrd
-rw-r--r-- 1 root root 47992 May 10 14:56 localhost_mem_buffers_3.rrd
-rw-r--r-- 1 root root 47992 May 10 14:56 localhost_mem_swap_4.rrd
-rw-r--r-- 1 root root 47992 May 10 14:56 localhost_proc_7.rrd
-rw-r--r-- 1 root root 47992 May 10 14:56 localhost_users_6.rrd

However, these were generated when i ran 'php poller.php' Does the cron need to run under the linux cactiuser context? It's running in root's crontab right now...

Thanks,
acd
Attachments
cacti2.JPG
cacti2.JPG (120.64 KiB) Viewed 2575 times
anjancd
Posts: 6
Joined: Wed May 09, 2007 12:06 pm

Post by anjancd »

And yes, i had to change the Settings->rrdtool utility version to 1.2.x for the graphs to appear.

-acd
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Change ownership of rrd files to cactiuser:cactiuser to allow cactiuser to update and httpd to read
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests