@AndoniLarz opened this Issue on February 11th 2018

Hello,

I've been trying to install Matomo on an Heroku free dyno, to test it.
I downloaded Matomo on my PC and pushed it on Heroku.
My first problem is that, as you may know, Heroku uses ephemeral filesystem and free dynos sleep after 30 minutes of inactivity. This causes the installation process to be triggered every time the dyno is woken up.

It looks like the solution is to store sessions in the database using the session_save_handler = dbtable in the [General] section of my config/config.ini.php file.
As far as I understand, this config.ini.php file must be generated automatically at the end of the installation process, correct me if I'm wrong.
So my current problem is that I push the matomo code to Heroku, I process the installation via the web interface, but it doesn't create a config.ini.php.

If I try to create it myself, with only thesession_save_handler = dbtable line before pushing to Heroku, it doesn't work and throws MySQL errors :

Cannot connect to the database:

SQLSTATE[HY000] [2002] No such file or directory

If I create it and add all this code :

[General]
session_save_handler = dbtable

[database]
host = "<?php echo(getenv('DATABASE_HOST')); ?>"
username = "<?php echo(getenv('DATABASE_USER')); ?>"
password = "<?php echo(getenv('DATABASE_PASSWORD')); ?>"
dbname = "<?php echo(getenv('DATABASE_NAME')); ?>"

I get another type of error :

Cannot connect to the database:

SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known

So I'm kinda lost right now since I guess I should use the config.ini.php, but if I use it I'm getting errors.

@vickyveera10 commented on February 22nd 2018

Hi,
I got same this issue ,In heroku php using create a config file its not working please anyone know how to fix this ..

Powered by GitHub Issue Mirror