Mombu the Php Forum sponsored links

Go Back   Mombu the Php Forum > Php > GPG in PHP
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 5th May 05:26
emil
External User
 
Posts: 1
Default GPG in PHP



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
  Reply With Quote


  sponsored links


2 5th May 05:26
mailist
External User
 
Posts: 1
Default GPG in PHP



I'm just curious, what happens if you execute the command directly
from the command line? Does it work or do you get the same error?
  Reply With Quote
3 5th May 05:26
nrixham
External User
 
Posts: 1
Default GPG in PHP


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
  Reply With Quote
Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666