As we know, PHP web application (also Yii2) establish a DB connection when application start and shut it down with application end. So we can’t share a DB connection between web app and console app directly. For example we’d like to accept a web request and generate some temporal tables via the background console app (proc_open), then access them in this web request subsequent process.
We had tried to make a console call via yii2-command-bus --> symphony-process --> proc_open, and it failed. It can’t see the temporary tables which created by web in the console process. Theoretically speaking, three are two separated PROCESSES, and they maintenance DB connections themselves. I think shell_exec should leads the same result…