Opened 21 months ago

Last modified 21 months ago

#93 new defect

Piwik 2.17.1

Reported by: chris Owned by: chris
Priority: minor Milestone: Maintenance
Component: piwik Version:
Keywords: Cc:
Estimated Number of Hours: 0 Add Hours to Ticket: 0
Billable?: yes Total Hours: 0.75

Description

Not urgent, no security updates, see https://piwik.org/changelog/piwik-2-17-1/

Change History (1)

comment:1 Changed 21 months ago by chris

  • Add Hours to Ticket changed from 0 to 0.75
  • Total Hours set to 0.75

Following the notes at Piwik#Upgrades:

sudo -i
cd /var/www
vi piwik/config/config.ini.php
export PIWIK="2.13.0"
wget "https://builds.piwik.org/piwik-$PIWIK.tar.gz"
wget "https://builds.piwik.org/piwik-$PIWIK.tar.gz.asc"
gpg --verify piwik-$PIWIK.tar.gz.asc
cp piwik/config/config.ini.php .
tar -zxvf piwik-$PIWIK.tar.gz
cp config.ini.php piwik/config/
chown -R piwik:piwik /var/www/piwik/
php /var/www/piwik/console core:update
vi piwik/config/config.ini.php

Checking the web interface there was this issue:

LOAD DATA INFILE

Using LOAD DATA INFILE will greatly speed Piwik's archiving process up. To make it available to Piwik, try updating your PHP & MySQL software and make sure your database user has the FILE privilege.
If your Piwik server tracks high traffic websites (eg. > 100,000 pages per month), we recommend to try fix this problem.
Error: LOAD DATA INFILE failed... Error was:
Try #1: LOAD DATA INFILE : SQLSTATE[HY000]: General error: 1290 The MySQL server is running with the --secure-file-priv option so it cannot execute this statement
Troubleshooting: FAQ on piwik.org

There isn't a perms issue, Apache runs as piwik and we have:

ls -lah piwik/tmp/ | grep assets
drwxr-xr-x  2 piwik piwik 4.0K Dec 14 11:34 assets

The MySQL command was run:

mysql 

mysql> GRANT FILE on *.* to "piwik@localhost";
Query OK, 0 rows affected (0.00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 0 rows affected (0.17 sec)

But that didn't help so these config options were added to /etc/mysql/my.cnf:

[mysqld]
local-infile    = 1

[mysql]
local-infile    = 1

And MySQL was restarted, but that didn't solve it, the next suggestion, adding the following to piwik/config/config.ini.php:

adapter = MYSQLI

Resulted in this error:

Error: Mysqli prepare error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'option
(option_name,option_value)
VALUES (?,?)' at line 1

In terms of the PHP settings in the /etc/apache2/sites-enabled/10-piwik.conf file we have:

        <IfModule mod_php5.c>
                php_admin_value open_basedir /var/www/piwik
                php_admin_value upload_tmp_dir /var/www/piwik/tmp
                php_admin_value session.save_path /var/www/piwik/tmp
                php_admin_value file_uploads 1
                php_admin_value geoip.custom_directory /var/www/piwik/misc
        </IfModule>

And I don't think these should be changed, the other suggestion:

on Ubuntu / Debian servers, you may try to uninstall php5-mysql package and install instead php5-mysqlnd: sudo apt-get install php5-mysqlnd

Isn't really something I want to do during the day as this is a production server, so I think I'll look at this again one evening and in the mean time this has been added to /etc/mysql/my.cnf:

[general]
enable_load_data_infile =       0
Note: See TracTickets for help on using tickets.