Piwik doesn't finish loading pages [SOLVED]

Hey folks!

I have this peculiar issue that I’m not sure on how to debug. I installed Piwik on both my VPS and a wardrobe server, the latter having the following hardware specifications:

CPU: ARM-based 1.2 GHz network processor
Memory: 512 MB internal high-speed DDR-II RAM, running at 800 MHz
Network: 2 x Gigabit Ethernet interfaces

Both have Debian 6.0 installed and the issue here is that on the wardrobe server the pages stop loading (literally) halfway through, botching the CSS and not displaying all HTML elements. On the other hand, Wordpress runs just fine on that hardware.

I’m a rookie on this subject (well, subjects) and could use some friendly advice on where to look for more information.

Do you see any error in your webserver error log?

Pardon the delay, I’ve been away for a while.

I checked the output of top while accessing and browsing Piwik on the server and it always rises to above 90 %.

/var/log/apache2/error.log output:


[Fri Sep 23 10:44:56 2011] [error] [client xxx.xxx.xxx.xxx] PHP Fatal error:  Maximum execution time of 30 seconds exceeded in /xxx/www/piwik/libs/jsmin/jsmin.php on line 141, referer: http://www.xxx.com/piwik/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday

I also get these JavaScript errors when visiting the website in Chrome:


SyntaxError: Unexpected identifier [xxx.com/piwik/index.php?module=Proxy&action=getJs&cb=f137110b795e7ee4efec72e0d265dab7:2]
ReferenceError: $ is not defined [xxx.com/piwik/index.php?module=CoreHome&action=index&idSite=1&period=day&date=yesterday:119]

Also, the language selection menu is displayed as a native dropdown menu with a button entitled “go” next to it rather than the subtle default design (which looks like a plain link).

Alright I’ve tried to pinpoint the error but no success so far…

... Maximum execution time of 30 seconds exceeded in /xxx/www/piwik/libs/jsmin/jsmin.php on line 141 ...

This points to the following with the specific line in bold:

protected function get() {
    $c = $this->lookAhead;
    $this->lookAhead = null;
    if ($c === null) {
        if ($this->inputIndex < $this->inputLength) {
            [b]$c = substr($this->input, $this->inputIndex, 1);[/b]
            $this->inputIndex += 1;
        } else {
            $c = null;
        }
    }
    if ($c === "\r") {
        return "\n";
    }
    if ($c === null || $c === "\n" || ord($c) >= self::ORD_SPACE) {
        return $c;
    }
    return ' ';
}

Google tells me this script is a “JavaScript Minifier”, sadly I can’t claim to understand JavaScript but possibly this is a bug. I have downloaded and reinstalled Piwik several times now with the same result.

The minifier is taking too long and your server has a max_execution limit. In your config/config.ini.php, add the following:


[Debug]
disable_merged_assets = 1

This is normally used for debugging, but it’s the only quick fix I can propose at this time.

Thank you, adding that line did the trick. Piwik runs smoothly and I haven’t noticed anything else acting up. All my packages (Debian Squeeze) seem to be up to date as well. I’d happily provide more information if it helps figuring out this… oddity.

For reference, here is the FAQ: Troubleshooting - Analytics Platform - Matomo

Oops. Sorry. I skimmed through that earlier but didn’t connect the dots.

I set the max timeout in php.ini to 300 instead of 30 (and removed the disable_merged_asset line in Piwik) and now it works! Very cool, thanks!