I ran into a different issue when playing with a completely different docker system. The issue was the environment stuff was not available from within the container. Are the Env Vars available within the container? Just a thought - don’t really understand dockers TBH
You could put some debug statements into the process_settings.php file to check it is actually doing something.
Final thought, you don’t have a settings.php file do you…
Hi!
Yes, the env vars are in the container. They are listed with correct values when attaching to container and running the env command.
No, no settings.php
I have little to no clue about PHP. But I see the function concatinates string to some $error_out variable so I did the same. Where would that be displayed? Can’t see it in /var/log/emoncms/emoncms.log
function ini_check_envvars($config) {
global $error_out;
$error_out .= "I'm in ini_check_envvars";
foreach ($config as $section => $options) {
$error_out .= "Looping config";
foreach ($options as $key => $value) {
// Find {{ }} vars and replace what's within them with the
// named environment var
$error_out .= "check options";
if (strpos($value, '{{') !== false && strpos($value, '}}') !== false) {
preg_match_all( '/{{([^}]*)}}/', $value, $matches);
foreach ($matches[1] as $match) {
$error_out .= "Matched {{ }} and found ${match}";
if (!isset($_ENV[$match])) {
$error_out .= "<p>Error: environment var '${match}' not defined in config section [${section}], setting '${key}'</p>";
} else {
$newval = str_replace('{{'.$match.'}}', $_ENV[$match], $value);
// Convert booleans from strings
if ($newval === 'true') {
But I looked more closely at the process_settings.php
This line is interesting…
Un-commenting that line however gives loads of errors.
**Warning** : Invalid argument supplied for foreach() in **/var/www/emoncms/process_settings.php** on line **93**
**Warning** : Invalid argument supplied for foreach() in **/var/www/emoncms/process_settings.php** on line **93**
**Warning** : Invalid argument supplied for foreach() in **/var/www/emoncms/process_settings.php** on line **93**
**Warning** : Invalid argument supplied for foreach() in **/var/www/emoncms/process_settings.php** on line **93**
**Warning** : strpos() expects parameter 1 to be string, array given in **/var/www/emoncms/process_settings.php** on line **96**
**Warning** : strpos() expects parameter 1 to be string, array given in **/var/www/emoncms/process_settings.php** on line **96**
**Warning** : preg_match_all() expects parameter 2 to be string, array given in **/var/www/emoncms/process_settings.php** on line **97**