Title: Error trying to run electrum through PHP's shell_exec() Post by: TimeIsBitcoin on September 11, 2013, 06:46:53 PM I'm trying to use Electrum from the command line for a little project of mine using PHP. Running commands from the terminal (in Ubuntu) works just fine. But when I try running them through PHP using something like $output = `/usr/local/bin/electrum listaddresses 2>&1`;, I get the following error:
Code: Traceback (most recent call last): Do you have any idea why that would be? It's running php on the same machine, with the same owner as I ran in the terminal, so I can't imagine it being a permissions issue. Thanks a bunch. Title: Re: Error trying to run electrum through PHP's shell_exec() Post by: TimeIsBitcoin on September 12, 2013, 02:02:46 AM I've found the problem, though I don't know the proper solution, since I'm not too familiar with python. Apparently "os.environ" isn't giving me the complete info in util.py when the program is executed using PHP's shell_exec(). "HOME" is missing, for some reason (as well as other things), so it returns nothing, causing this error. I just hard coded my directory path in for now until I find a fix.
|