need help with crypt_gpg

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
totus
Forum Newbie
Posts: 1
Joined: Sun Nov 01, 2009 10:57 pm

need help with crypt_gpg

Post by totus »

I seem to have gotten the environment and packages straight on the system and I'm able to run the following sample code which encrypted a webpage and stores it. Then displays it.

Code:

Code: Select all

<?php
 
require_once 'Crypt/GPG.php';
 
$gpg = new Crypt_GPG();
$gpg->addEncryptKey('dummy@dummy.com');
// you can use any fopen-able stream
$gpg->encryptFile('http://dummy.com/', './file.html.asc');
#echo Complete<p>;
$file = file_get_contents('./file.html.asc', true);
echo $file;
My new issue is that is executes fine via cli "php encrypt.php" as apache. However when I make an http request I get nothing. The http logs show this:

Code:

Code: Select all

 
[Fri Oct 30 16:51:20 2009] [error] [client 24.243.34.79] PHP Warning:  require_once(Crypt/GPG.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /var/www/vhosts/dummy.com/httpdocs/enrollment/encrypt.php on line 3
[Fri Oct 30 16:51:20 2009] [error] [client 24.243.34.79] PHP Fatal error:  require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'Crypt/GPG.php' (include_path='.:/usr/share/pear') in /var/www/vhosts/dummy.com/httpdocs/enrollment/encrypt.php on line 3
The /usr/share/pear path is set properly in /etc/php.ini, I noticed there is another php.ini file in /usr/local/psa/admin/conf/php.ini and I tried adding it there as well. Apache hup and still same results.

This is on Redhat and Plesk.
:banghead:
Post Reply