In this tutorial im going to solve this erorr openssl_pkey_export(): cannot get key from parameter 1, this error is coming when try to generate public and private key.

Error :- openssl_pkey_export(): cannot get key from parameter 1
Solution :-
First go to control panel and open -> View Advance system settings

Open Environments variables.

Copy variable name -> OPENSSL_CONF
Next go to xampp and copy below code
C:\xampp\apache\conf\openssl.cnf

Next restart your system. Hopefully your problem has been resolved.