This time to everyone to bring PHP does not compile installation OpenSSL extension implementation, PHP does not compile installation of the OpenSSL extension of the attention to what, the following is the actual case, together to see.
When using the RSA algorithm in PHP, you need to call the Openssl_get_publickey method, but you also need to compile the OpenSSL extension to PHP, otherwise you will be prompted with the following error:
Call to undefined function openssl_get_publickey ()
Since PHP has been installed, how to install OPENSS without compiling it. This is done in the following way:
Go to PHP source code path
Cd/php-5.6.19/ext/openssl
Compiling with Phpize
CP CONFIG0.M4 CONFIG.M4 Phpize
The Configure file is generated so that you can use the make command to install
Special Note: You need to set the environment variables for the PHP installation path.
Perform a Make installation
./configure--with-php-config=/usr/local/cp-php-5.6.19/bin/php-config--with-openssl
Special Note: You need to install OpenSSL first
PHP.ini Add extensions to configure OpenSSL extensions
Extension=openssl.so
Verify that the increase is successful
Php-m
You can see all the extensions of PHP
Believe that you have read the case of this article you have mastered the method, more exciting please pay attention to the PHP Chinese network other related articles!
Recommended reading:
How the PHP generator uses
Request a refund from PHP