I am a pretty novice Linux user. I've configured a LAMP server to use primarily for a central syslog server. Ubuntu 16.04, with the latest stable versions of Apache, php7, and mariadb. I've primarily been following this tutorial to configure Loganalyzer (https://cloud4wi.zendesk.com/hc/en-us/articles/201827513-How-to-install-and-configure-a-SysLog-Server).
I successfully tested sending syslog messages to it and can see the database is collecting them so far. I've also successfully tested php can connect to the database I've setup for rsyslog
<?php
$link = mysqli_connect("{host}", "{user}", "{password}", "{database}");
if (!$link) {
echo "Error: Unable to connect to MySQL." . PHP_EOL;
echo "Debugging errno: " . mysqli_connect_errno() . PHP_EOL;
echo "Debugging error: " . mysqli_connect_error() . PHP_EOL;
exit;
}
echo "Success: A proper connection to MySQL was made!." . PHP_EOL;
echo "Host information: " . mysqli_get_host_info($link) . PHP_EOL;
mysqli_close($link);
?>
I then run this command from the command line php -f db-test.php and it seems to work.
My problem seems to arise when running the Loganalyzer install.php file.
At the section where I include the database info and creds, it gives me a fairly useless error.
ERROR: Cannot use the database 'rsyslogdb'! If the database does not exists, create it or check user access permissions! Mysql Error - Description:
I've checked my apache logs, and they seemed to point to a problem with the install.php script. Initially I got an error stating a "call to undefined function mysql_connect" which is where I found out the install script was using old functions ("Call to undefined function mysql_connect()" after upgrade to php-7). This is rather curious as the notes from Loganalyzer seem to indicate they fixed this issue (http://loganalyzer.adiscon.com/news/loganalyzer-v4-1-5-v4-stable-released/)
I just changed two old functions in the script to use mysqli_connect and mysqli_select_db to see what would happen. I got a little further, but the apache logs are still showing errors and I cannot progress in the Loganalyzer install.
[Mon Dec 12 15:23:21.563908 2016] [:error] [pid 1400] [client {ip}:50958] PHP Warning: mysqli_select_db() expects parameter 1 to be mysqli, string given in /var/www/html/loganalyzer/install.php on line 382, referer: http://{ip}/loganalyzer/install.php?step=3
>>> this is the line from install.php
// Try to select the DB!
$db_selected = mysqli_select_db($_SESSION['UserDBName'], $link_id);
if(!$db_selected)
RevertOneStep( $content['INSTALL_STEP']-1, GetAndReplaceLangStr( $content['LN_INSTALL_ERRORACCESSDENIED'], $_SESSION['UserDBName']) . "<br>" . DB_ReturnSimpleErrorMsg());
[Mon Dec 12 15:23:21.563997 2016] [:error] [pid 1400] [client {IP}:50958] PHP Warning: mysqli_errno() expects parameter 1 to be mysqli, integer given in /var/www/html/loganalyzer/include/functions_db.php on line 215, referer: http://{ip}/loganalyzer/install.php?step=3
[Mon Dec 12 15:23:21.564013 2016] [:error] [pid 1400] [client {IP}:50958] PHP Warning: mysqli_error() expects parameter 1 to be mysqli, integer given in /var/www/html/loganalyzer/include/functions_db.php on line 215, referer: http://{ip}/loganalyzer/install.php?step=3
>>>> this is the line from functions_db.php
// Return Mysql Error
return "Mysql Error " . mysqli_errno($userdbconn) . " - Description: " . mysqli_error($userdbconn);
}
I've been banging my head against the wall for a while now. Can someone point me in the right direction please?