Using gnupg with php - errors

From: Date: Sat, 14 Apr 2001 17:39:56 +0000
Subject: Using gnupg with php - errors
Groups: php.general 
Request: Send a blank email to php-general+get-48562@lists.php.net to get a copy of this message
Hello all, This has been covered before, but I can't get it to work and I've searched all the archives already. I am trying to encrypt a small string of data. I am using a script by Richard Lynch as my starting point. I found it here: http://www.weberdev.com/get_example.php3?count=1379 Now, I am on MacOSX trying to get this thing to work. I installed an OSX version of gnupg 1.04, without any problems, and created to sets of keys. My idea is to get this to work on my local machine first, then eventually get it to work on my web hosting account. Here is the code I am using:
putenv("HOME=/Users/sohara/"); // Explanation follows... $command = "echo '$data' | /usr/local/bin/gpg -a --batch --no-secmem-warning -e -u 'sohara@sohara.com' -r 'alien8@alien8recordings. com'" ; // Actually execute the command $result = exec($command, $encrypted, $errorcode); if ($errorcode) { echo "Error $errorcode encrypting your data.<br>\n"; exit; } $encrypteddata = implode("\n", $encrypted); echo "This is the encrypted data:<br> $encrypted \n";
And this always gives returns an error number 2. I can't find a list of error numbers at gnupg, so the error number isn't very helpful so far. Does anyone know about the gnupg error numbers, or just using gnupg with php? Thanks, Sean

« previous php.general (#48562) next »