系统:运行 Debian 5.0.1、Apache 2 和 PHP 5.2.6 的 Amazon EC2 实例
我需要使用 PHP 脚本发送加密文件。我原本打算使用脚本中的命令行指令(例如 exec())来执行此操作,但发现 GnuPG 有一个 PHP 扩展。我按照提供的步骤安装了它本演练,尽管我使用了上述软件包的最新版本(libgpg-error-1.10、gpgme-1.3.1 和 gnupg-1.3.2)。当我进入 gnupg-1.3.2 安装的“make”步骤时,系统提示我运行“make test”。当我这样做时,我收到以下错误/警告:
PHP Warning: PHP Startup: Unable to load dynamic library 'modules/curl.so' - modules/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'modules/curl.so' - modules/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'modules/gd.so' - modules/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'modules/gd.so' - modules/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'modules/mcrypt.so' - modules/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'modules/mcrypt.so' - modules/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'modules/mysql.so' - modules/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'modules/mysql.so' - modules/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'modules/mysqli.so' - modules/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'modules/mysqli.so' - modules/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'modules/pdo.so' - modules/pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'modules/pdo.so' - modules/pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'modules/pdo_mysql.so' - modules/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'modules/pdo_mysql.so' - modules/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'modules/gnupg.so' - libgpgme.so.11: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'modules/gnupg.so' - libgpgme.so.11: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'modules/curl.so' - modules/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'modules/curl.so' - modules/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'modules/gd.so' - modules/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'modules/gd.so' - modules/gd.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'modules/mcrypt.so' - modules/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'modules/mcrypt.so' - modules/mcrypt.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'modules/mysql.so' - modules/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'modules/mysql.so' - modules/mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'modules/mysqli.so' - modules/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'modules/mysqli.so' - modules/mysqli.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'modules/pdo.so' - modules/pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'modules/pdo.so' - modules/pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'modules/pdo_mysql.so' - modules/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'modules/pdo_mysql.so' - modules/pdo_mysql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'modules/gnupg.so' - libgpgme.so.11: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'modules/gnupg.so' - libgpgme.so.11: cannot open shared object file: No such file or directory in Unknown on line 0
=====================================================================
PHP : /usr/bin/php
PHP_SAPI : cli
PHP_VERSION : 5.2.6-1+lenny13
ZEND_VERSION: 2.2.0
PHP_OS : Linux - Linux ip-10-235-58-131 2.6.21.7-2.fc8xen #1 SMP Fri Feb 15 12:34:28 EST 2008 x86_64
INI actual : /etc/php5/cli/php.ini
More .INIs : /etc/php5/cli/conf.d/curl.ini,/etc/php5/cli/conf.d/gd.ini,/etc/php5/cli/conf.d/gnupg.ini,/etc/php5/cli/conf.d/mcrypt.ini,/etc/php5/cli/conf.d/mysql.ini,/etc/php5/cli/conf.d/mysqli.ini,/etc/php5/cli/conf.d/pdo.ini,/etc/php5/cli/conf.d/pdo_mysql.ini
CWD : /var/apache2/sites/gnupg-1.3.2
Extra dirs :
=====================================================================
Running selected tests.
SKIP import a new key into the keyring [tests/gnupg_oo_0001_import.phpt]
SKIP encrypt and decrypt a text [tests/gnupg_oo_encrypt.phpt]
SKIP encryptsign and decryptverify a text [tests/gnupg_oo_encryptsign.phpt]
SKIP export a key [tests/gnupg_oo_export.phpt]
SKIP get keyinfo [tests/gnupg_oo_keyinfo.phpt]
SKIP list signatures [tests/gnupg_oo_listsignatures.phpt]
SKIP sign a text with sigmode SIG_MODE_CLEAR [tests/gnupg_oo_sign_clear.phpt]
SKIP sign a text with mode SIG_MODE_DETACH [tests/gnupg_oo_sign_detach.phpt]
SKIP sign a text with mode SIG_MODE_DETACH and without armored output [tests/gnupg_oo_sign_detach_nonarmor.phpt]
SKIP sign a text with mode SIG_MODE_NORMAL [tests/gnupg_oo_sign_normal.phpt]
SKIP sign a text with mode SIG_MODE_NORMAL and without armored output [tests/gnupg_oo_sign_normal_noarmor.phpt]
SKIP delete a key from the keyring [tests/gnupg_oo_zzz_deletekey.phpt]
FAIL import a new key into the keyring [tests/gnupg_res_0001_import.phpt]
FAIL encrypt and decrypt a text [tests/gnupg_res_encrypt.phpt]
FAIL encryptsign and decryptverify a text [tests/gnupg_res_encryptsign.phpt]
FAIL export a key [tests/gnupg_res_export.phpt]
FAIL get keyinfo [tests/gnupg_res_keyinfo.phpt]
FAIL list signatures [tests/gnupg_res_listsignatures.phpt]
FAIL sign a text with sigmode SIG_MODE_CLEAR [tests/gnupg_res_sign_clear.phpt]
FAIL sign a text with mode SIG_MODE_DETACH [tests/gnupg_res_sign_detach.phpt]
FAIL sign a text with mode SIG_MODE_DETACH and without armored output [tests/gnupg_res_sign_detach_nonarmor.phpt]
FAIL sign a text with mode SIG_MODE_NORMAL [tests/gnupg_res_sign_normal.phpt]
FAIL sign a text with mode SIG_MODE_NORMAL and without armored output [tests/gnupg_res_sign_normal_noarmor.phpt]
FAIL delete a key from the keyring [tests/gnupg_res_zzz_deletekey.phpt]
=====================================================================
Number of tests : 24 12
Tests skipped : 12 ( 50.0%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 12 ( 50.0%) (100.0%)
Tests passed : 0 ( 0.0%) ( 0.0%)
---------------------------------------------------------------------
Time taken : 1 seconds
=====================================================================
=====================================================================
FAILED TEST SUMMARY
---------------------------------------------------------------------
import a new key into the keyring [tests/gnupg_res_0001_import.phpt]
encrypt and decrypt a text [tests/gnupg_res_encrypt.phpt]
encryptsign and decryptverify a text [tests/gnupg_res_encryptsign.phpt]
export a key [tests/gnupg_res_export.phpt]
get keyinfo [tests/gnupg_res_keyinfo.phpt]
list signatures [tests/gnupg_res_listsignatures.phpt]
sign a text with sigmode SIG_MODE_CLEAR [tests/gnupg_res_sign_clear.phpt]
sign a text with mode SIG_MODE_DETACH [tests/gnupg_res_sign_detach.phpt]
sign a text with mode SIG_MODE_DETACH and without armored output [tests/gnupg_res_sign_detach_nonarmor.phpt]
sign a text with mode SIG_MODE_NORMAL [tests/gnupg_res_sign_normal.phpt]
sign a text with mode SIG_MODE_NORMAL and without armored output [tests/gnupg_res_sign_normal_noarmor.phpt]
delete a key from the keyring [tests/gnupg_res_zzz_deletekey.phpt]
它表示除了 gnupg 之外无法加载的库列表(curl、gd、mcrypt、mysql、mysqli、pdo 和 pdo_mysql)都存在于 gnupg.so 文件旁边的扩展目录中,并且它们都显示在 php_info() 中,但 gnupg 扩展并未显示在那里。此外,从错误中可以看出,所有经过测试的 gnupg 函数都失败了。有人有什么建议吗?
答案1
解决了。我链接的演练在 Ubuntu 10.04 系统上可以正常工作,但显然不适用于需要它的 Debian 服务器。我需要安装一些其他软件包才能使其正常工作:
- libgpg-error0_1.6-1
- libpth20_2.0.7-16
- libpth-dev_2.0.7-16
- libgpg-错误-dev_1.6-1
- libgpgme11_1.2.0-1.2
- libgpgme11-dev_1.2.0-1
所有这些都可以从包在 Debian 网站上