Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 02 Feb 2004 15:19:14 -0600
From:      "W. D." <WD@US-Webmasters.com>
To:        freebsd-questions@freebsd.org
Subject:   Help!!!  GPG (GnuPG) & PHP:  system Safe Mode workarounds?
Message-ID:  <5.1.0.14.2.20040202150544.08489680@209.152.117.178>
In-Reply-To: <871xptmhkj.fsf@strauser.com>
References:  <5.1.0.14.2.20040121002805.05e63ec0@209.152.117.178> <5.1.0.14.2.20040120193001.05cca510@209.152.117.178> <5.1.0.14.2.20040120193001.05cca510@209.152.117.178> <5.1.0.14.2.20040121002805.05e63ec0@209.152.117.178>

next in thread | previous in thread | raw e-mail | index | archive | help
Hi Folks,

I finally got GPG "portupgraded'--not the latest version, but it works.
It it works fine on the command line.  However, I am trying to=20
send an encrypted email using PHP.

The problem is that PHP is in "safe mode" on the server, and
won't let me do something like any of these:

<?
$msg =3D 'Stuff to encrypt"
$GPGdir =3D '/usr/local/bin/gpg';
$To =3D 'EmailAddresThatHasAPGPkey@SomeDomain.com';

$cmd =3D "echo $msg | $GPGdir -a --always-trust -e -r $To";

// This won't work:
$EncryptedMsg =3D `$cmd`;

// Nor this:
system($cmd, $EncryptedMsg);

// Ditto:
exec($cmd, $EncryptedMsg);

// More of the same:
$EncryptedMsg =3D shell_exec($cmd);

?>

Surely, some FreeBSD gurus know how to get around this
restriction????  I am not the first person to have
this problem, am I?

Aaarrgh!  Please help!

Start Here to Find It Fast!=99 -> http://www.US-Webmasters.com/best-start-pa=
ge/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5.1.0.14.2.20040202150544.08489680>