Import Log Analytics Not Working!


#1

Hi,

I’ve been trying to make log-analytics work for days and it’s just not working. The “import_logs.py” upon running gives PHP Fatal error: Uncaught exception ‘Zend_Db_Adapter_Mysqli_Exception’ even though mysqli is installed.

I’ve even spoken to my VPS provider and they ensured Mysqli extension and PDO is installed so it should work fine. However, piwik keep throwing the following error. Any help would be much appreciated. Many thanks in advance.


[root@srv1 log-analytics]# python import_logs.py --url=http://mydomain.com --idsite=3 --recorders=4 --enable-http-errors --enable-http-redirects --enable-static --enable-bots /usr/local/apps/apache/logs/log_file.log
Fatal error: `php /home/rnadmin/public_html/stats/misc/cron/updatetoken.php --piwik-domain=mydomain.com` failed with error: PHP Fatal error: Uncaught exception 'Zend_Db_Adapter_Mysqli_Exception' with message 'The Mysqli extension is required for this adapter but the extension is not loaded' in /home/rnadmin/public_html/stats/libs/Zend/Db/Adapter/Mysqli.php:291
Stack trace:
#0 /home/rnadmin/public_html/stats/libs/Zend/Db/Adapter/Abstract.php(315): Zend_Db_Adapter_Mysqli->_connect()
#1 /home/rnadmin/public_html/stats/core/Db/Adapter.php(45): Zend_Db_Adapter_Abstract->getConnection()
#2 /home/rnadmin/public_html/stats/core/Db.php(104): Piwik\Db\Adapter::factory('MYSQLI', Array)
#3 /home/rnadmin/public_html/stats/core/Db.php(53): Piwik\Db::createDatabaseObject()
#4 /home/rnadmin/public_html/stats/misc/cron/updatetoken.php(57): Piwik\Db::get()
#5 {main}
thrown in /home/rnadmin/public_html/stats/libs/Zend/Db/Adapter/Mysqli.php on line 291
PHP Fatal error: Uncaught exception 'Zend_Db_Adapter_Mysqli_Exception' with message 'The Mysqli extension is required for this adapter but the extension is not loaded' in /home/rnadmin/public_html/stats/libs/Zend/Db/Adapter/Mysqli.php:291
Stack trace:
#0 /home/rnadmin/public_html/stats/libs/Zend/Db/Adapter/Abstract.php(315): Zend_Db_Adapter_Mysqli->_connect()
#1 /home/rnadmin/public_html/stats/core/Db/Adapter.php(45): Zend_Db_Adapter_Abstract->getConnection()
#2 /home/rnadmin/public_html/stats/core/Db.php(104): Piwik\Db\Adapter::factory('MYSQLI', Array)
#3 /home/rnadmin/public_html/stats/core/FrontController.php(265): Piwik\Db::createDatabaseObject()
#4 /home/rnadmin/public_html/stats/core/FrontController.php(183): Piwik\FrontController->init()
#5 [internal function]: Piwik\FrontController::triggerSafeModeWhenError()
#6 {main}
thrown in /home/rnadmin/public_html/stats/libs/Zend/Db/Adapter/Mysqli.php on line 291
.
Reponse code was: 255. You can alternatively run the importer using the --login and --password option


(Matthieu Aubry) #2

Hi there,

ask your admins to check that Mysqli is also enabled for PHP CLI (not only for PHP apache/nginx)