简体   繁体   中英

Install GNUPG on xampp windows

I want to use PGP in my PHP project, using XAMPP on Windows.

When I run this code:

$public_key = "PGP Public Key";
$gpg = new gnupg();
$key = $gpg->import($public_key);
$gpg->addencryptkey($key['fingerprint']);
$enc = $gpg->encrypt("Hello Stackoverflow!");
$gpg->clearencryptkeys();
echo nl2br($enc);

I get an error message telling me that I have to install the GNUPG extension in my Apache server.

How do I install GNUPG for XAMPP on Windows? I only found solutions for Linux.

You need to add libgpgme-11.dll, php_gnupg.dll, libgpg-error.dll

Extensions pack to your php.ini configuration file

https://www.gnupg.org/download/index.html

As per the official php-gnupg repository, there's no extension for Windows yet.

The extension is not currently supported on Windows due to unavailable GpgME library builds that would be supported by PHP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM