Help - Search - Members - Calendar
Full Version: GPG and PHP
The Planet Forums > Control Panels > cPanel/WHM
Jeewhizz
OK, i need to use gpg to encrypt some form data...

echo "hello" | gpg --always-trust -ear cs@sitehq.co.uk

works fine on the command line, but not for exec, shell_exec(), passthru() and system() etc etc...

Does anyone know how to use it? I can use other system commands and get the result - its just this gpg string!

Oh.. safemode is OFF!

And PHP is compiled with apache - not as a cgi module.. and i'd like to keep it this way icon_wink.gif

Thanks

Jee
webbcite
You need to run it as cgi mode. The problem is running it as apache mode runs the script as the user apache...which won't work.

There is a how-to I wrote to get it working...it has been a while and an older version of PHP, but should get you pointed in the right direction:

http://forum.rackshack.net/showthread.php?...=&threadid=9985
Jeewhizz
I found that - but on cpanel it'll just re-install php as a module when it does its updates - or so i'm lead to believe icon_sad.gif
webbcite
Moved to Cpanel General Server Talk >

Since this is related to Cpanel, you will probably get better hits and info in this section.
Michaeln
Jeewhizz,

The latest copy of /scripts/easyapache should install a copy of php as a cgi for you. Look in /usr/bin/ and see if you can't find php in there.

If it is not there run easy apache if you would like to upgrade your apache anyway. Probably do not need to.

Otherwise download the php source from php.net and install it as either a cgi or cli sapi.

Then rename your php script to filename.cgi.
Be sure to put the following line at the top:
#!/usr/bin/php

If you install the cli version instead of the cgi version you will need to start the file off like this:
#!/usr/bin/php
echo 'Content-type: text/htmlnn';

Otherwise you will get a 500 error.

Regards,
Michael
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.