How to check if OpenSSL version is installed> = 0.9.8k

I have a PHP 5.x script that requires OpenSSL 0.9.8k or higher.

Regarding OpenSSL, I found the following two relevant constants:

OPENSSL_VERSION_TEXT (with value 'OpenSSL 1.0.0c 2 Dec 2010') OPENSSL_VERSION_NUMBER (with value '268435519') 

Unfortunately, I do not know how to perform the specified verification of these values.

+6
source share
3 answers

Source version 0.9.8k has the constant OPENSSL_VERSION_NUMBER from 0x009080bf

 <?php if(OPENSSL_VERSION_NUMBER < 0x009080bf) { echo "OpenSSL Version Out-of-Date"; } else { echo "OpenSSL Version OK"; } ?> 
+6
source

If you like a single line command:

 php -r "echo OPENSSL_VERSION_NUMBER;" 
+3
source

printInfo () should tell you if there is openSSL support

+2
source

Source: https://habr.com/ru/post/910642/


All Articles