After installing the necessary modules, run the following command
azure account -help
works as expected. However, when I call the same command from PHP using exec ().
exec('azure account -help',$output,$responseCode)
and print the output, I get
$ output: [] (empty array) and $ responseCode: 8
I tried to execute the module using the node command. Ex
node / usr / lib / node_modules / azure-cli / bin / azure.js account -help
This also works on the command line, but not through PHP exec.
Edit: redirecting stderr with the following command:
exec('azure account -help &2>1',$output,$responseCode)
gives the following data:
E === undefined) && & (process.env.HOMEDRIVE === undefined))) {throw new Error (, ^, Error: HOME not found, could not save the reverse Streamline cache to Object. (/ Usr / local / lib / node_modules / azure-cli / node_modules / streamline / lib / compiler / compile.js: 278: 90), in Module._compile (module.js: 456: 26), in Object.Module._extensions..js (module .js: 474: 10), in Module.load (module.js: 356: 32), in Function.Module._load (module.js: 312: 12), in Module.require (module.js: 364: 17 ), on demand (module.js: 380: 17), in Object. (/usr/local/lib/node_modules/azure-cli/node_modules/streamline/lib/compiler/register.js:28:15), in Module ._compile (module.js: 456: 26), in Object.Module._extensions..js (module.js: 474: 10)
What can I try to debug this further?