Page 1 of 1

Install 4.1.5 on Ubuntu 16.04 with MySQL

PostPosted: Thu Jun 22, 2017 2:06 pm
by WildcatLeeds
Hi all,

I've been running into problems the past few days and I've exhausted most of the information that I could find on the Internet. Ubuntu 16.04 LTS, Loganalyzer 4.1.5 (I've used the tar and a deb package with same results), MySQL 5.7, PhP 7.0, Apache 2.4

I'm not sure what I'm doing wrong but I keep getting the following message when I get to the database setup portion of install.php:

[Thu Jun 22 13:49:37.588072 2017] [:error] [pid 31715] [client xxx.xxx.xxx.xxx:19619] PHP Fatal error: Uncaught Error: Call to undefined function mysql_connect() in /usr/share/loganalyzer/install.php:377\nStack trace:\n#0 {main}\n thrown in /usr/share/loganalyzer/install.php on line 377, referer: http://<servername>/loganalyzer/install.php?step=3

This is in my apache2 error log after I click on next after ticking the radio button for enabling the User DB.

I have tried 'phpenmod pdo_mysql' and I've uncommented the extension in /etc/php/7.0/apache2/php.ini. I did install php7.0-mysql and php7.0-common.

Can someone please guide me in the right direction?

Thanks much

Re: Install 4.1.5 on Ubuntu 16.04 with MySQL

PostPosted: Fri Oct 20, 2017 9:46 pm
by vinceroi
I am having the exact same error message with Debian 9 / MariaDB10.1.26 / Apache/2.4.25 (Debian) / PHP 7.0.19-1

Have you found the solution?

I've never specified the MySQL login so I can expect the mysql_connect to fail....so maybe a permission issue?

Re: Install 4.1.5 on Ubuntu 16.04 with MySQL

PostPosted: Fri Oct 20, 2017 11:34 pm
by vinceroi
I've found the reason. This is because mysql_connect is obsolete in PHP7. We have to use PHP5 or use mysqli or PDO instead. A bug should be open with Adiscon.

Re: Install 4.1.5 on Ubuntu 16.04 with MySQL

PostPosted: Mon Oct 23, 2017 4:42 pm
by vinceroi
A workaournd is explained in https://github.com/rsyslog/loganalyzer/issues/17 :
in install.php, replace mysql_connect with mysqli_connect
and replace mysql_select_db with mysqli_select_db
and comment out the 2 lines:
//if(!$db_selected)
//RevertOneStep( $content['INSTALL_STEP']-1, GetAndReplaceLangStr( $content['LN_INSTALL_ERRORACCESSDENIED'], $_SESSION['UserDBName']) . "<br>" . DB_ReturnSimpleErrorMsg());

Then you will be able to go to the next step of the installation.