Page 1 of 1

Configuring different environments

Posted: Mon Dec 14, 2020 6:04 am
by pawansaxena
Hello all,

I am running processmaker 3.4, i can see that there is a env.ini file residing in the workflow/engine/config directory but that have some environment values as APP_ENV and it is set to production.
Also there's a environments.php file in the same directory but with different variables, i am not sure whether that file plays a role anymore or it is just sitting there.

Whenever i see the logs ( even on dev i see the production text in the logs and not dev, as i have not setup the dev env)
Can anyone help me as where and how can i use different env.ini files for different environment and tell processmaker to use respective environment values.

Re: Configuring different environments

Posted: Mon Dec 21, 2020 2:28 pm
by programerboy
Hi,
You can check this link for get available settings:
https://wiki.processmaker.com/3.5/Configuration_File_env.ini

http://pmlearning.info
Thanks

Re: Configuring different environments

Posted: Sun Jan 17, 2021 9:56 pm
by pawansaxena
This is a good wiki link. But whenever i want to set some environment variable, i didn't want to go and change the .env.ini file directly. I wanted to extend this functionality to have some .env in project root.

I am able to do so by changing some code in System.php inside /workflow/engine/src/Processmaker/Core/System.php

Inside getSystemConfiguration method add below lines :
Code: Select all
if (!empty($globalIniFile)) {
            $appEnvFile = app()->environmentFile();
            $appEnvFilePath = PATH_TRUNK . $appEnvFile;
            if (file_exists($appEnvFilePath)) {
                if (($appEnvConfig = @parse_ini_file($appEnvFilePath)) !== false) {
                    $config = array_merge($config, $appEnvConfig);
                }
            }
        }

        if (!empty($wsIniFile)) {
            $appEnvFile = app()->environmentFile();
            $appEnvFilePath = PATH_DB . $wsName . PATH_SEP . $appEnvFile;
            if (file_exists($appEnvFilePath)) {
                if (($appEnvConfig = @parse_ini_file($appEnvFilePath)) !== false) {
                    $config = array_merge($config, $appEnvConfig);
                }
            }
        }
Hope it helps someone.

Cheers !!!

Re: Configuring different environments

Posted: Sat Jan 22, 2022 2:07 pm
by ljglmail
When I start my processmaker server in production mode, I can see that the application directory is using folder structure as follows: www.omegle.fyi
www.chatrandom.one
www.bazoocam.fyi
I am looking for the environment variable APP_ENV, but the documentation does not specify the value for APP_ENV.

Appreciate if you could help me out with reference guide or pointers on how to set environment variables for processmaker 3.4.

Re: Configuring different environments

Posted: Thu Mar 23, 2023 5:39 am
by MichaelFinn
It is tough to build an environment. Those who know how to read code can easily get to know about the solution to this problem. If you are unable to deal with programming tasks then drop your request at irelandassignmenthelp.ie we will surely assist you.