Help with Setup on Debian (SOLVED)

I’ve gone through the installation guide on the website but I’m still facing problems on installing piwik.

I am using a raspberry pi (Debian stretch). I have all the piwik requirements, I try installing using the 5-minute method and I’ve placed and extracted piwik in a proper directory but when I visit my localhost, the website page is blank, the piwik web installer is not loaded.

My DocumentRoot in my virtual host points to /home/pi/testingsite and I placed and extracted piwik to /home/pi/testingsite, this should work, but doesn’t for some reason. There aren’t many piwik installation guides on the internet, so I must ask here.

I want someone here in this forums to give me a step-by-step, I’m willing to start everything from scratch and follow your instructions.

Please help

Hi,

This means that some PHP error is occurring (probably something that can be solved quickly/maybe a missing dependencies).

Can you check the php error log? There should be the corresponding error message, which tells what exactly is wrong.

for php, I did sudo sudo apt-get install php7.0 php7.0-curl php7.0-gd php7.0-cli mysql-server php7.0-mysql php-xml php7.0-mbstring this is what the instructions page says…

So, I think it might be something else? Where is the php error log, I’ll post it here to let you check

EDIT: right click and view page source has the following:

<?php
/**
 * Piwik - free/libre analytics platform
 *
 * @link http://piwik.org
 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
 *
 * @package Piwik
 */

if (!defined('PIWIK_DOCUMENT_ROOT')) {
    define('PIWIK_DOCUMENT_ROOT', dirname(__FILE__) == '/' ? '' : dirname(__FILE__));
}
if (file_exists(PIWIK_DOCUMENT_ROOT . '/bootstrap.php')) {
    require_once PIWIK_DOCUMENT_ROOT . '/bootstrap.php';
}
if (!defined('PIWIK_INCLUDE_PATH')) {
    define('PIWIK_INCLUDE_PATH', PIWIK_DOCUMENT_ROOT);
}

require_once PIWIK_INCLUDE_PATH . '/core/bootstrap.php';

if (!defined('PIWIK_PRINT_ERROR_BACKTRACE')) {
    define('PIWIK_PRINT_ERROR_BACKTRACE', false);
}

require_once PIWIK_INCLUDE_PATH . '/core/dispatch.php';

So this tells me that piwik is being loaded, but something is missing, that’s why it doesn’t load properly

Hi,

If you can see the PHP code in the browser (which it seems like), you haven’t configured your web server (apache or nginx) to use PHP for .php files

right click, view page source, the page itself is blank

I’m only showing the page source to see if something is being loaded and yes, piwik is showing up, but the page itself is blank

I’ve installed the required LAMP stack. I have linux, a working apache2, installed mysql but not sure if it’s working, and installed php.

EDIT: my steps are:
For apache2: sudo apt-get install apache2 -y
For mysql: sudo apt-get install mysql-server -y
For php: sudo apt-get install php7.0 php7.0-curl php7.0-gd php7.0-cli mysql-server php7.0-mysql php-xml php7.0-mbstring

Is this right so far? I also tried placing piwik in the default /var/www/html directory, delete the default index.html then restart by sudo /etc/init.d/apache2 restart refresh the page and still blank

Hi,
I am not sure if libapache2-mod-php got installed as it is needed for apache to use PHP.

I haven’t used Apache in years so I can’t give you a step-by-step manual, but you’ll need to configure Apache to use PHP.

oddly enough, all the tutorials I’ve read have the mysql prompt them to enter root password during installation, but I never got that prompt? Has it been removed in debian stretch or maybe the latest version of mysql doesn’t do that anymore?

I mean the command sudo apt-get install mysql-server -y is supposed to ask you to enter your password during installation, I never got it, which I think is odd

EDIT: ok, I’ve followed the link you posted, and I can confirm that php is not working with apache2, not even a simple php code. I’ll purge my system and install everything from scratch, not sure if I messed up somewhere.

I’ll do that and I’ll update when I’m done

1 Like

Ok, got php to work with apache2 and now piwik installation finishes.

Now, I need help on accurate geolocation.

I followed this: How do I install the GeoIP Geo location PECL extension? - Analytics Platform - Piwik

I did: sudo apt-get install php-geoip php-dev libgeoip-dev but when I run sudo pecl install geoip

I get the error: ERROR:make’ failed` I think this is another dependency issue.

What other things do I need to install in order for this to work?

Hi,

You Onlinemedien to run this if you want to compile the geoip php module from scratch. But thankfully you don’t need to as the „php-geoip“ package already includes the module. (This is also mentioned in the linked guide)

Were you able to get php to work (e.g. running phpmyadmin)?

yes php works now, I’ve reinstalled everything because I messed up my certbot.

I’ll go through everything again and I’ll update.

1 Like

Ok, everything now installed and working. I haven’t tried the geolocation accuracy yet, but am I installing the PECL geolocation correctly?

Let’s go over my setup: install PECL by following the tutorial > https://piwik.org/faq/how-to/#faq_163

Added this to the bottom of my php.ini geoip.custom_directory=/path/to/piwik/misc

And finally renamed the geoip database file from GeoLiteCity.dat to GeoIPCity.dat

This is how it looks like in my web admin:

It says installed but on the right: ORG and ISP are unknown. I click on refresh and still no new data. Is everything in order?

Geolocation is not working: image

Has a question mark, my location data is not showing up

Hi,

Have you replaced /path/to/piwik/misc with the real path to the Piwik misc folder and restartet php?

yes, mine is at /var/www/html/piwik/misc

I restarted my system and still the same

This is the website I’m testing piwik with > https://seeyourplace.sytes.net

I can’t think of any solution, apart from checking the PHP error logs.

But if you aren’t getting thousands of visitors (which I doubt if you are using a Raspberry Pi), you could try GeoIP (PHP).

Tip from someone who used to host his websites on a Raspberry Pi: Make regular backups of your data outside of the Raspberry Pi. I can’t count how often the data on the SD-card got corrupted.

But what did I do wrong that it doesn’t work? I think my installation is correct, is it working for you?

EDIT: I’ve changed it to GeoIP (PHP) click on the refresh button on the right and still no data is showing.

Something’s wrong…any command I could use to check? Or maybe a log ?

It is working on my server, but I have installed the geoip-database-contrib debian-package, which automatically fetches the latest database files. In addition I haven’t changed the php.ini

I don’t know where Apache puts the PHP logs, but var/log/php or var/log/apache are possible.

I don’t know where the php logs are, but my apache logs seem fine, I don’t see any obvious errors.

Is there something else that I can try? maybe a command to check things out?

What do you suggest I do?

Hm, only thing I can think of (apart from trying out ) is temporarily enabling display_errors in the php.ini.

Ok, in my php.ini I change display_errors from Off to On. Restarted apache2 by sudo /etc/init.d/apache2 restart

php should be displaying errors now.

Just to double check, does my geoip.custom_directory look right to you?

image

Is the web admin page supposed to show the path to geoip.custom_directory? Mine seems to be blank…