FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=16368&edit=1

ID: 16368
Comment by: kmuk
Reported By: kmailuk+pear at gmail dot com
Summary: proc_open() not supported
Status: Wont fix
Type: Feature/Change Request
Package: Crypt_GPG
Operating System: Linux (CentOS)
Package Version: 1.0.0
PHP Version: 5.2.4
New Comment:

My website host has also disabled proc_open() recently. This broke my
email script which sent gpg-signed emails. I too would be interested in
any work-arounds. Thanks.


Previous Comments:
------------------------------------------------------------------------

[2009-06-23 02:32:21] ejm1

I understand.

Ironically, they do support shell_exec().

It would be nice if there was a limited functionality version of
Crypt_GPG_Engine that used shell exec and had only one input file
descriptor (created using shell pipes with '|') and one output file
descriptor, that threw errors if you tried to do anything more
complicated than basic things.

------------------------------------------------------------------------

[2009-06-23 02:25:00] gauthierm

The passthru(), exec(), and system() functions also have the same
problem.

------------------------------------------------------------------------

[2009-06-23 02:18:45] gauthierm

<div id="changeset">
<span class="removed">-Status: Open</span>
<span class="added">+Status: Wont fix</span>
</div>Unfortunately, the GPG process requires input and output from
multiple file descriptors. The shell_exec() function only supports
output to one file descriptor (STDOUT) and doesn't support input from
any file descriptors.

Also, your host has more than likely also disabled shell_exec() if they
have disabled proc_open().

------------------------------------------------------------------------

[2009-06-23 01:24:27] ejm1

Description:
------------
I know its not a bug, but my web host has disabled the use of
proc_open() for security reasons.
Is there any way to get Crypt_GPG to use shell_exec() or some other
alternative method for process calls?

Test script:
---------------
<?php
require_once 'Crypt/GPG.php';
$gpg = new Crypt_GPG();
$gpg->addEncrytKey("mykey@email.com");
echo $gpg->encrypt("Hello World!");

Expected result:
----------------
(...Expecting the encrypted output...)

Actual result:
--------------
Warning: proc_open() has been disabled for security reasons in
/home/<me>/php/Crypt/GPG/Engine.php on line 1216

Fatal error: Uncaught Crypt_GPG_OpenSubprocessException: Unable to open
GPG subprocess. in /home/<me>/php/Crypt/GPG/Engine.php on line 543
#0 /home/<me>/php/Crypt/GPG/Engine.php(543):
Crypt_GPG_Engine->_openSubprocess()
#1 /home/<me>/php/Crypt/GPG.php(675): Crypt_GPG_Engine->run()
#2 /home/<me>/php/Crypt/GPG.php(1406):
Crypt_GPG->getKeys('mykey@email....')
#3 /home/<me>/php/Crypt/GPG.php(1228): Crypt_GPG->_addKey(Array, true,
false, 'mykey@email....')
#4 Command line code(1): Crypt_GPG->addEncryptKey('mykey@email....')
#5 {main}
thrown in /home/<me>/php/Crypt/GPG/Engine.php on line 1219

------------------------------------------------------------------------

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedFeb 21, '10 at 10:01a
activeFeb 21, '10 at 10:01a
posts1
users1
websitepear.php.net

1 user in discussion

Kmuk: 1 post

People

Translate

site design / logo © 2022 Grokbase