<?php
// Create the keypair
$res=openssl_pkey_new();
// Get private key
openssl_pkey_export($res, $privkey);
// Get public key
$pubkey=openssl_pkey_get_details($res);
$pubkey=$pubkey["key"];
Fatal error: Uncaught Error: Call to undefined function openssl_pkey_new() in /in/oZO15:3
Stack trace:
#0 {main}
thrown in /in/oZO15 on line 3
Process exited with code 255.