singpolyma / openpgp-php

OpenPGP.php is a pure-PHP implementation of the OpenPGP Message Format (RFC 4880).
http://singpolyma.github.io/openpgp-php/
The Unlicense
180 stars 69 forks source link

Class 'phpseclib\Crypt\RSA' not found #50

Closed Arinerron closed 7 years ago

Arinerron commented 7 years ago
PHP Fatal error:  Class 'phpseclib\Crypt\RSA' not found in openpgp-php/lib/openpgp_crypt_rsa.php on line 13

Are there dependencies I'm missing?

singpolyma commented 7 years ago

How did you install it? You need phpseclib >=2.0.0

Arinerron commented 7 years ago

I git cloned

jasekiw commented 7 years ago

please run composer install to install the dependencies. composer - https://getcomposer.org/

Oros42 commented 7 years ago

I have got the same error.

This is how I solved it :

git clone https://github.com/singpolyma/openpgp-php
cd openpgp-php
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php composer-setup.php
php -r "unlink('composer-setup.php');"
php composer.phar install

And put in ./lib/openpgp.php at line 16, this :

include "../vendor/autoload.php";
DanielRuf commented 7 years ago

You should use the autoload file in your own project. Generally this is exactly what is written in the comments before your answer.