Is there a way to generate a private key through OpenSSL in PHP using openssl-pkey-new in RSA and PKCS1?
if you mean the private key with the title BEGIN RSA PRIVATE KEY, then in PHP there is one problem that does not have a simple solution. Basically, PHP compiled with OpenSSL 1.0+ produces PKCS # 8 PEM private keys with formatting, and it seems that there is no way how to generate it in PKCS # 1 format (at least I could not find a solution).
https://bugs.php.net/bug.php?id=53850
Why different lines of private key in Linux or Windows?
There is also a library called phpseclib that can do this. (but I have no personal experience).
http://phpseclib.sourceforge.net/rsa/examples.html#create,pkcs1,pkcs1pub,sign1,enc1,