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 Emil

are 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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to