openssl_private_encrypt() has a low limit for the length of the data it can encrypt due to the nature of the algorithm.
To encrypt the larger data you can use openssl_encrypt() with a random password (like sha1(microtime(true))), and encrypt the password with openssl_public_encrypt().
This way the data can be encrypted with a public key and decrypted with the private one.