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

后端 未结 3 1761
傲寒
傲寒 2021-01-02 21:51

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

In regard to OpenSSL, I found the following two relevant constants:

OPENSSL_VERSION         


        
相关标签:
3条回答
  • 2021-01-02 22:13

    The source for version 0.9.8k has a constant OPENSSL_VERSION_NUMBER of 0x009080bf

    <?php
    
    if(OPENSSL_VERSION_NUMBER < 0x009080bf) {
        echo "OpenSSL Version Out-of-Date";
    } else {
        echo "OpenSSL Version OK";
    }
    
    ?>
    
    0 讨论(0)
  • 2021-01-02 22:13

    If you like the one line command though:

    php -r "echo OPENSSL_VERSION_NUMBER;"
    
    0 讨论(0)
  • 2021-01-02 22:13

    printInfo() output should tell you if you have openSSL support

    0 讨论(0)
提交回复
热议问题