PHP not intialising after installing Cacti

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

subuiy06
Posts: 9
Joined: Mon Jan 30, 2006 7:33 am

PHP not intialising after installing Cacti

Post by subuiy06 »

Hi ,

I am new to cacti & php environment ,

below is the error

Fatal error: Call to undefined function mysql_pconnect() in c:\Inetpub\wwwroot\Cacti\lib\adodb\drivers\adodb-mysql.inc.php on line 355


Regards,
Subu
GamBit
Posts: 21
Joined: Thu Feb 20, 2003 9:46 am

PHP Extension

Post by GamBit »

You have to enter the Lines

extension=mysql.so
extension=snmp.so

in yout php.ini!
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

If you're running MySQL 4.1 then you will need to apply the old password trick for user authentication to work with Cacti.

1. Stop the MySQL service, edit your my.ini file, and add the following:

#Use old password encryption method (needed for 4.0 and older clients).
old-passwords

2. You will also need to update the cactiuser account with the old password style:

shell> UPDATE mysql.user SET Password = OLD_PASSWORD('cactipw') WHERE Host = 'localhost' AND User = 'cactiuser';
mysql> FLUSH PRIVILEGES;
subuiy06
Posts: 9
Joined: Mon Jan 30, 2006 7:33 am

Errors repeated .

Post by subuiy06 »

Hi,

Have tried the given solution but have not solved the problem.

Also, posting the errors occurred.

--------------------------------------------------------------------------------------
Warning: session_start() [function.session-start]: open(C:\WINDOWS\TEMP\\sess_16d462b9bc70cb9f342fad7e006d5111, O_RDWR) failed: Permission denied (13) in c:\Inetpub\wwwroot\Cacti\include\config.php on line 95

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at c:\Inetpub\wwwroot\Cacti\include\config.php:95) in c:\Inetpub\wwwroot\Cacti\include\config.php on line 95

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at c:\Inetpub\wwwroot\Cacti\include\config.php:95) in c:\Inetpub\wwwroot\Cacti\include\config.php on line 95

Fatal error: Call to undefined function mysql_pconnect() in c:\Inetpub\wwwroot\Cacti\lib\adodb\drivers\adodb-mysql.inc.php on line 355

Warning: Unknown: open(C:\WINDOWS\TEMP\\sess_16d462b9bc70cb9f342fad7e006d5111, O_RDWR) failed: Permission denied (13) in Unknown on line 0

Warning: Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct () in Unknown on line 0
------------------------------------------------------------------------------------

If someone knows to rectify this errors pls do let me know.

Thanks.
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

You need to give IIS_USR modify rights to C:\WINDOWS\TEMP\ so PHP can store the session files.

Make sure you have php_mysql.dll uncommented from php.ini.
subuiy06
Posts: 9
Joined: Mon Jan 30, 2006 7:33 am

PHP and IIS

Post by subuiy06 »

Hi,

Have tried the suggested options and now again facing the same old error .

Fatal error: Call to undefined function mysql_pconnect() in c:\Inetpub\wwwroot\Cacti\lib\adodb\drivers\adodb-mysql.inc.php on line 355


Thanks.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Open a command prompt/shell and type the following:

"php -m" and "php -v".

Post the output.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
subuiy06
Posts: 9
Joined: Mon Jan 30, 2006 7:33 am

Post by subuiy06 »

C:\Documents and Settings\suiyer>php -m
PHP Warning: PHP Startup: Unable to load dynamic library 'c:\php\ext\msql.so' -
The specified module could not be found.
in Unknown on line 0
[PHP Modules]
bcmath
calendar
com_dotnet
ctype
date
dom
ftp
iconv
libxml
mysql
odbc
pcre
Reflection
session
SimpleXML
snmp
sockets
SPL
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
zlib

[Zend Modules]


C:\Documents and Settings\suiyer>php -v
PHP Warning: PHP Startup: Unable to load dynamic library 'c:\php\ext\msql.so' -
The specified module could not be found.
in Unknown on line 0
PHP 5.1.2 (cli) (built: Jan 11 2006 16:40:00)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies

I have tried copying libmySQL.dll to windows\system32 folder
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

Why are you trying to use a Linux plugin? c:\php\ext\msql.so you should be using *.dll instead of *.so files.

libmySQL.dll in your windows directory won't fix anything. Please read this any apply the fix: http://dev.mysql.com/doc/refman/5.0/en/old-client.html
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

After just a few hours of sleep, BSOD hit's one out of the ballpark :)

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
saki
Posts: 12
Joined: Wed Feb 01, 2006 4:10 pm

Same Problem

Post by saki »

Hi, I'm new to PHP and Cacti and I'm having this same issue.

Here's a few things about the server.

[PHP Modules]
bcmath
calendar
com_dotnet
ctype
date
dom
ftp
iconv
libxml
odbc
pcre
Reflection
session
SimpleXML
SPL
standard
tokenizer
wddx
xml
xmlreader
xmlwriter
zlib

[Zend Modules]

and

PHP 5.1.2 (cli) (built: Jan 11 2006 16:40:00)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies


I went into the ini file and made the discussed changes to the file. I have a question though, while looking around in the file I came across this.

[SQL]
sql.safe_mode = OFF

[ODBC]
odbc.default_db = Not yet implemented
odbc.default_user = Not yet implemented
odbc.default _pw = Not yet implemented


I know that's not correct and I'm in the learning stages of mysql, so I'm at a loss of what to do here.

I also made sure all the security settings were in place for all the folders talked about and they were all done.

Thanking you guys in advance :)
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Post by BSOD2600 »

saki:
1) Read the install guide in my signature
2) You don't need to mess with the [SQL] or [ODBC] sections
3) You haven't enabled the php_mysql.dll plugin in php.ini
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

Saki,

You are also missing the php_snmp.dll and php_sockets.dll extensions.

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
saki
Posts: 12
Joined: Wed Feb 01, 2006 4:10 pm

Post by saki »

Ok followed your guide step by step and am now getting this.

Fatal error: Call to undefined function read_config_option() in c:\Cacti\auth_login.php on line 139
C:/net-snmp/etc/snmp/snmp.conf: line 2: Warning: Unknown
token: persistenDir. C:/net-snmp/etc/snmp/snmp.conf; line 3:
Warning: Unknown token: tempFilePattern.
User avatar
TheWitness
Developer
Posts: 17007
Joined: Tue May 14, 2002 5:08 pm
Location: MI, USA
Contact:

Post by TheWitness »

You are almost there. What version of PHP are you running?

TheWitness
True understanding begins only when we realize how little we truly understand...

Life is an adventure, let yours begin with Cacti!

Author of dozens of Cacti plugins and customization's. Advocate of LAMP, MariaDB, IBM Spectrum LSF and the world of batch. Creator of IBM Spectrum RTM, author of quite a bit of unpublished work and most of Cacti's bugs.
_________________
Official Cacti Documentation
GitHub Repository with Supported Plugins
Percona Device Packages (no support)
Interesting Device Packages


For those wondering, I'm still here, but lost in the shadows. Yearning for less bugs. Who want's a Cacti 1.3/2.0? Streams anyone?
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests