Piwik & Google App Engine



For some reasons, I would like to use Google App Engine to host my Piwik. The only thing I need is that AppEngine works as a WebService in order to make it called by the JavaScripts trackers of my websites.
However, we can’t write to the filesystem on AppEngine, that causes a lot of issue when Piwik tries to create files/folders, either cache or tmp.

Do you think it could still be possible to install Piwik on AppEngine? (Using Cloud SQL for the data at the same time)


(Matthieu Aubry) #2

Maybe it is possible. As a start, please test with Piwik 2.3.0

If you have any problem let me know here I will try to help!

One of the thing that may help is to enable DB sessions: How do I use the database to store session files, instead of storing sessions in files? - Analytics Platform - Matomo


I’m trying to do the same thing as Stephane . Here are the steps :

  • Downloaded the last piwik version (2.10.0)
  • Installed the PHP sdk for appengine.
  • Added the app.yaml file :
    [center]application: <app_id>
    version: 1
    runtime: php
    api_version: 1


  • url: /.*
    script: index.php[/center]

  • added the config/config.ini.php file with the database configuration (google cloud sql) and
    [center]session_save_handler = dbtable
    backends[] = array[/center]

  • added the php.ini file with
    [center]google_app_engine.enable_functions = “php_sapi_name”[/center]

then : appcfg.py update

and i am getting a Piwik Error

[center]Piwik couldn’t write to some directories .

Try to Execute the following commands on your server, to allow Write access on these directories:

chown -R www-data:www-data /base/data/home/apps/s~azapiwikisp/1.381856447577620345
chmod -R 0755 /base/data/home/apps/s~azapiwikisp/1.381856447577620345/tmp
chmod -R 0755 /base/data/home/apps/s~azapiwikisp/1.381856447577620345/tmp/assets/
chmod -R 0755 /base/data/home/apps/s~azapiwikisp/1.381856447577620345/tmp/cache
chmod -R 0755 /base/data/home/apps/s~azapiwikisp/1.381856447577620345/tmp/logs/
chmod -R 0755 /base/data/home/apps/s~azapiwikisp/1.381856447577620345/tmp/tcpdf/
chmod -R 0755 /base/data/home/apps/s~azapiwikisp/1.381856447577620345/tmp/templates_c/[/center]

In the google cloud platform logs i have :
[center]E 11:10:31.698 2015-01-29 200 1.14 KB 135ms /index.php
E 11:10:32.069 2015-01-29 200 1.14 KB 258ms /plugins/Morpheus/stylesheets/simple_structure.css
E 11:10:32.363 2015-01-29 200 1.14 KB 226ms /plugins/Morpheus/images/logo-header.png[/center]

with that Piwik Error.

Any idea about this problem ?