Endless "loading widget"

Hi all,

I have installed Piwik on my website just an hour or so ago. I downloaded latest.zip, unzipped it locally and transferred the unzipped package on my shared hosting web space via FTP. The installation wizard ran just fine and reported that the tables have been successfully created in the database. So far, so good.

I am however having a problem in that most of the widgets on the dashboard take a looong time before displaying anything. At first, I thought it was Opera doing its thing again and turned to Firefox. Things actually got worse as even less widgets ended up showing anything other than “loading widget, please wait…” after more than 20 minutes (see the attached screenshot – in French). I’ve also attached the Firebug console.

My first assumption was that the database link was dead. But then I shouldn’t even be able to log in, right?

I have scrupulously followed all instructions I’ve found, be it Piwik instructions or my hosting company instructions about the database.

Does anyone have any idea about what the problem may be there?

It looks like the php process is dying on the back end. Check your web server log files (e.g., /var/log/apache2/error.log).

Typical troubleshooting and workarounds:

If you’re getting a segfault, upgrade to a newer php version.
If you’re getting out-of-memory, try increase php’s max memory_limit.
If the process is being killed for running too long, increase max_execution_time.
If the process is unable to establish a database connection, check your mysql server config for max connections.

The thing is, I’m on a shared hosting configuration with my hands tied. I can’t configure anything, I can’t change anything in either the database or server or PHP config.

I’ve checked the variables you mention and I think the problem has to do with database connections. DB connections are limited to 30 simultaneous connections according to the hosting company’s guides, but phpinfo reports a mysql.max_links value of “Unlimited” on the server. This looks to me like a potential source of problems and I have reported it to the support but they’re dragging their feet instead of fixing the php configuration.

The error logs I can access are useless as the only messages I see look like

[Mon Apr 30 10:00:57 2012] [error] [client] [host waavsolutions.com] Premature end of script headers: index.php, referer: Sign in - Piwik

Please ask your webhost to investigate since it’s a config/system issue

The solution to this problem has been to replace

$sessionPath = PIWIK_USER_PATH . '/tmp/sessions';


$sessionPath = PIWIK_USER_PATH . '/tmp/';

in file /Core/Session.php

I’ve been told that changing

session_save_handler = files


session_save_handler = dtable

in /config/global.ini.php can also help.

Amenel, the 2nd solution you provide has worked for me (not the 1st one). Many thanks for your help!

Glad to have helped!