PHP Open OpenSSL method

Source: Internet
Author: User
This article introduces the content is about PHP open OpenSSL method, has a certain reference value, now share to everyone, the need for friends can refer to

Today debug program prompt, please open OpenSSL, originally in most cases, OpenSSL is not open, to enable the need to make the following simple settings

PHP to open the OpenSSL method, in most cases, OpenSSL is not open, to enable the need to make the following simple settings

windows open Method:

1: first check the php.ini; Extension=php_openssl.dll exists, if present, remove the previous comment '; ', if it does not exist, add Extension=php_openssl.dll.
2: Speak the PHP folder under: Php_openssl.dll, Ssleay32.dll, Libeay32.dll 3 files copied to the Windows\system32\ folder.
3: Restart Apache or IIS (Iisreset/restart)

At this point, the OpenSSL function is turned on.

Linux under Open method:

I am using the Brocade Data Cloud Host, PHP version: 5.2.14
The following scenario takes my host as an example to add the OpenSSL module support for PHP.
Some of the online answers say to recompile PHP, add configure parameters, and increase the support of OpenSSL. Here is a method that does not require recompilation.
If the server exists PHP installation package files Best, if you have deleted, go to download and Phpinfo page display version of the same PHP installation files, I here is php-5.2.14.tar.gz
Recommended to Sohu image download, NetEase image not found. Address: http://mirrors.sohu.com/php/
Connect to the host using the SSH tool.


Copy the Code code as follows:


# download to the/VAR/WWW/PHP5 directory
Cd/var/www/php5
wget http://mirrors.sohu.com/php/php-5.2.14.tar.gz
# Unzip
Tar zxvf php-5.2.14.tar.gz
# Enter the OpenSSL Extension Module directory of PHP
CD php-5.2.14/ext/openssl/
/var/www/php5/bin/phpize # Here for your own phpize path, if not found, use Whereis phpize find
# after execution, found the error can not find Config.m4, CONFIG0.M4 is config.m4. Rename directly
MV Config0.m4 CONFIG.M4
/var/www/php5/bin/phpize
./configure--with-openssl--with-php-config=/var/www/php5/bin/php-config
Make
Make install
# When the installation is complete, a directory of. so files (openssl.so) is returned. In this directory, copy the openssl.so file to the extension_dir you specified in php.ini (find in the php.ini file: Extension_dir =), my directory here is var/www/php5/lib/php/ Extensions
# Edit the php.ini file, add at the end of the file
Extension=openssl.so
# Restart Apache
/usr/local/apache2/bin/apachectl restart

OK, now you have successfully added OpenSSL support.

Related recommendations:

The OpenSSL extension implements public key cryptography

PHP does not compile installation of the OpenSSL extension implementation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.