mysql_connect() failing

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

Moderators: Developers, Moderators

Post Reply
saltman
Posts: 4
Joined: Wed Apr 23, 2003 3:29 pm

mysql_connect() failing

Post by saltman »

Getting the following error when cmd.php tries to run:

<b>Fatal error</b>: Call to undefined function: mysql_connect() in <b>/www/cacti/include/database.php</b> on line <b>19</b>

Running Redhat 8.0, with the mysql rpm's installed, etc. All the PHP stuff is working fine and I verified that mysql is up and functioning.

Ideas?
chairul
Posts: 9
Joined: Thu Mar 27, 2003 10:14 pm

Re: mysql_connect() failing

Post by chairul »

Saltman,
My problem is exaclty the same with you.
I post my problem on Linux spesific board, but still no answer.
Seem that cacti is not working on RedHat 9 or 8 with standard install.

I asked RedHat support and they told me to ask it on cacti's board as nothing wrong with the RedHat installatiion.

But it was working fine in RedHat 7.1, 7.3 and RedHat advanced server 2.1.


Anybody can help us?????
User avatar
bulek
Cacti Pro User
Posts: 854
Joined: Mon May 20, 2002 2:07 am
Location: Poland
Contact:

Post by bulek »

Do you guys have "php-mysql" RPM installed along with other php and mysql RPM packages?

- bulek
chairul
Posts: 9
Joined: Thu Mar 27, 2003 10:14 pm

Post by chairul »

Hi
I found the problem is caused by config php in php.ini.
You must enable/uncoment line in php.ini: extension=mysql.so

By default it was uncommented.

Please try that, and I bet cacti will work..!!!!
saltman
Posts: 4
Joined: Wed Apr 23, 2003 3:29 pm

Post by saltman »

I tried your suggestion and it didn't go, instead, I rebuilt the box from scratch and added all the PHP and mysql rpm's manually, versus using Redhat's up2date. I noticed that redhat wasn't using the most current rpm's. Further, I switched to Apache 1.3 from 2.0 as there was a glaring warning about using PHP with Apache 2.0 in production, so...

Since then, I don't seem to be getting any errors and cacti is all happy.

Thanks!
wmelick
Posts: 34
Joined: Fri Apr 11, 2003 4:11 pm
Location: Wilmington, Delaware

Got mine working mostly

Post by wmelick »

I had cacti installed on RH7.3 but then moved it to a RH9 box. I tarred up the directory, sent it over to the new box and untarred and it seemed to work for about a day. I had to tweak a few of the snmpget and snmpwalk lines to work with the net-snmp syntax (namely replace $force_version with -v 2c) Then one afternoon I just couldn't login anymore. The cmd.php was still running fine as cron job and the rra's were still getting data. I wound up dumping out the cacti db, dropping it, creating a new one and reading the old dump back in. Now I can login and it has been working for about 3 days with out problems.

It's RH9 with the default RPMs (Apache 2.0.40, PHP 4.2.2, Net-SNMP 5.0.2) and I added rrdtool 1.0.42.

-Will
cosmicray

Re: mysql_connect() failing

Post by cosmicray »

Adding the php-mysql rpm *and* restarting apache worked for me. All is well.
james

Post by james »

I corrected mine by actually placing a copy of php.ini in /usr/local/lib

Now I can login and continue. I see graphs also but only if I run cmp.php from the command line as root.
user cactiuser still gets the mysql_connect() failing

trying to work that out!!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest