Welcome, Guest. Please login or register.

Author Topic: PHP Fatal error - Call to undefined function mysql_connect() after upgrade  (Read 2575 times)

angrybutler

  • Newbie
  • *
  • Posts: 14
    • View Profile
I just upgraded my Ubuntu install to 16.10 (xenial), and nedi 1.4 is now completely hosed.

It appears as if the new Ubuntu version strongly prefers php7.0 and mysql5.7.

Apparently Nedi 1.4 uses deprecated "mysql" functions in  libdb-mysql.php for mysql database access.

php7 appears to have completely abondoned mysql, and instead uses mysqli or mysqlnd functions instead.

I've spent many hours trying to figure out how to re-enable the "mysql" php functions with no joy.

Has anyone else run into this yet?   Is anyone aware of a fix?

Here's the complete error message from the Apache2 error.log:

[Mon Apr 18 17:02:12.461144 2016] [:error] [pid 27162] [client 127.0.0.1:44708] PHP Fatal error:  Uncaught Error: Call to undefined function mysql_connect() in /opt/nedi/html/inc/libdb-mysql.php:7\nStack trace:\n#0 /opt/nedi/html/index.php(61): DbConnect('localhost', 'nedi', <****>, 'nedi')\n#1 {main}\n  thrown in /opt/nedi/html/inc/libdb-mysql.php on line 7, referer: http://localhost/index.php?goto=Devices-List.php





rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2509
    • View Profile
    • NeDi
Indeed something that's been on my radar too. I've migrated NeDi 1.6 to mysqli now. It created another problem with NeDiO14, where php5-mysqli needs to be installed in order to make NeDi 1.6 work  >:(

Is there any chance you can revert to php5 on xenial for now?
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo

ascii

  • Jr. Member
  • **
  • Posts: 68
    • View Profile
i tired the update on VM a couple month ago.
had the same problem.

from now on debian stretch (Testing tree) pushes PHP 7 as default.
so on debian testing you have to mark php7 with hold if you want to use NeDi

tristanbob

  • Full Member
  • ***
  • Posts: 142
    • View Profile
I just upgraded Ubuntu to 16.04 and it broke just like you described. 

What is the best way around this?  Sounds like we need to get php5 installed again?   

I'll post if I find out how to get this working again.
Please visit "Other"->"Invoices" on your NeDi installation to make an annual contribution and support Nedi!

tristanbob

  • Full Member
  • ***
  • Posts: 142
    • View Profile
Ok, I got things working again by using PHP5.6, which requires using a PPA repository.

Code: [Select]

# This is needed for "apt-get-repository"
sudo apt-get install software-properties-common python-software-properties

# Add the new repo
sudo add-apt-repository ppa:ondrej/php

# Download package lists
sudo apt-get update

# Install Nedi dependencies
sudo apt-get install apache2 libapache2-mod-php5.6 mysql-server libnet-snmp-perl libcrypt-rijndael-perl libcrypt-hcesha-perl libcrypt-des-perl libdigest-hmac-perl libio-pty-perl libnet-telnet-perl libalgorithm-diff-perl librrds-perl php5.6-mysql php5.6-snmp php5.6-gd php5.6-mcrypt rrdtool libsocket6-perl

# I can't remember if this is required, or done by the packages above...
sudo a2enmod php5.6

# Restart Apache
sudo service apache2 restart

That should work for Ubuntu 16.04.  Let me know if I need to correct anything!
Please visit "Other"->"Invoices" on your NeDi installation to make an annual contribution and support Nedi!

harry

  • Full Member
  • ***
  • Posts: 124
    • View Profile
I also have same problem. I can not make ESXi file working from download
Waiting for  out of box working solution with 1.6 to test(with MySqli).....