3

I'm trying to implement a call to openssl_encrypt on my client's web server and I am getting a fatal error Unknown function: openssl_encrypt(). I thought requirement was PHP 5.3.0 and above? By the look of the phpinfo() dump the server is running 5.3.3.

What gives?

Honus Wagner
  • 2,830
  • 13
  • 44
  • 61
  • 1
    looking at the `phpinfo()` you can check the Configuration Command part, you'll see that you don't have `--with-openssl`. – Adi Jul 17 '12 at 15:20

2 Answers2

5

To use the openssl_ functions, you have to a) have OpenSSL installed, and b) build PHP with OpenSSL support. See the PHP OpenSSL docs.

To use PHP's OpenSSL support you must also compile PHP --with-openssl[=DIR]

Jonathon Reinhart
  • 132,704
  • 33
  • 254
  • 328
1

http://www.php.net/manual/en/openssl.requirements.php

In order to use the OpenSSL functions you need to install the » OpenSSL package. PHP between versions 4.0.5 and 4.3.1 will work with OpenSSL >= 0.9.5. Other versions (PHP <=4.0.4 and >= 4.3.2) require OpenSSL >= 0.9.6.

http://www.php.net/manual/en/openssl.installation.php

To use PHP's OpenSSL support you must also compile PHP --with-openssl[=DIR] .

mdziekon
  • 3,531
  • 3
  • 22
  • 32