Skip to content

PHP Fatal error: Uncaught Error: Class 'Elliptic\EC' not found #24

Description

@istabraq-iot

It shows me this error when i run this code:

<?php
require 'vendor/autoload.php';
use Elliptic\EC;

// Create and initialize EC context
// (better do it once and reuse it)
$ec = new EC('secp256k1');

// Generate keys
$key = $ec->genKeyPair();

$publicKey = $key->getPublic('hex');
$privateKey = $key->getPrivate('hex');

// Print the keys to the console

echo "The address1 is {$publicKey}. \r\n";
echo "The address1 is {$privateKey}. \r\n";

error:

PHP Fatal error: Uncaught Error: Class 'Elliptic\EC' not found in /home/istabraq/bctest/test2/test2.php:6
Stack trace:
#0 {main}
thrown in /home/istabraq/bctest/test2/test2.php on line 6

any help please?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions