Re: GPG in PHP
| From: | Nathan Rixham | Date: | Tue, 16 Sep 2008 13:39:59 +0000 |
| Subject: | Re: GPG in PHP | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-280272@lists.php.net to get a copy of this message | ||
Emil Edeholt wrote:
Hi! I have trouble executing gpg via php. GPG returns error code 127. I got like one google hit on that saying it had to do with open_basedir being on, it's off here. And anyway I would like to do this even if open_basedir was active. This is my test code (both return the same error): $result = exec("gpg -h", $output, $errorcode); $result = exec("gpg --list-keys", $output, $errorcode); Any ideas of what can be wrong? I've been asking some GPG folks, but haven't been able to get a good answer. Kind Regards Emilare you sure the apache user (www-data if still default) can run gpg? if not then you wanna chmod 777 /usr/bin/gpg OR add www-data to the sudoers file then exec("sudo gpg -h" ...) if that fails then you need to add a passwd to www-data (# passwd www-data) then try: exec("echo thepassword | sudo gpg -h" ...) if it's none of the above permission style things then I don't know so will leave it to somebody gpg proficient! regards