Install issue 0.4.3

First the installer was running just fine but we couldn’t complete the installation because we didn’t have pdo_mysql installed. We recompiled apache / php with all the required stuff but now we have a whole different problem.

When we load up the /piwik dir to start the installation procedure we immediately get this error:

Fatal error: Function __autoload(MySQL) threw an exception of type ‘Exception’ in /xyz/piwik/libs/Zend/Session.php on line 395

As far as I can see there it only starts the php session. I can’t imagine why it would throw me an exception.
(Note: all our normal enterprise php applications are running just fine)

Could anyone please help me with this matter?

Some additional info:

We are now running:
PHP Version 5.2.3
’./configure’ ‘–with-apxs2=/usr/local/apache2/bin/apxs’ ‘–with-mysql’ ‘–with-mysqli’ ‘–with-zlib’ ‘–with-gd=/usr/local/include’ ‘–with-jpeg-dir’ ‘–with-png-dir’ ‘–enable-ftp’ ‘–with-gettext’ ‘–with-openssl’ ‘–with-freetype-dir=/usr/local/lib’ ‘–with-tidy’ ‘–enable-mbstring’ ‘–with-mcrypt’ ‘–with-xsl’ ‘–with-curl’ ‘–with-sqlite=shared’ ‘–enable-soap’ ‘–enable-sockets’ ‘–enable-zip’ '–with-pdo-mysql–with-libmemcached-dir=/usr/local

The MySQL class isn’t a part of Piwik.

Elsewhere in your website, an app has referenced a MySQL object in the PHP $_SESSION superglobal. Zend Session is trying to unserialize the object and the autoloader (libs/Zend/Loader.php) can’t find the class definition.


  • moving Piwik to its own domain name or subdomain, or
  • creating a bootstrap.php file in your piwik folder, with a require_once to the ‘MySQL.class.php’ (or MySQL.php) file, or
  • copying the MySQL file to the libs folders, or
  • put an empty MySQL class definition in bootstrap.php, e.g., class MySQL {}

That’s weird. As I said it worked well the first time (before recompiling).
Piwik is running on its own subdir stand-alone with nothing else being called.

When I follow your advice and make a bootstrap.php file with a empty class MySQL {} I get

Exception: User could not be autoloaded. in /xyz/core/Loader.php on line 57

I know that this maybe isn’t Piwik that is being a pain in the ass, but any help on this matter would be more than welcome.

I have no idea why the Piwik autoloader is being called. There aren’t any User or Piwik_User classes either. Please add empty class definitions to your bootstrap.php as a workaround.

We already have a ticket open to better handle session data conflicts like these.

Another idea:

In bootstrap.php, replace the empty class definitions with:

ini_set('', 'Piwik');

Got it working by adding the libs dir to the include path in a bootstrap.php file.
Thanks for the help!

require_once ‘libs/Zend/Session.php’;

} catch (Exception $e) {
print_r('setup error: ’ . $e->getMessage() . “\n”);