How to open OpenSSL in PHP

Source: Internet
Author: User
Tags ini openssl

PHP to open the OpenSSL method, most of the OpenSSL is not open, to enable the need for a simple setting

windows open Method:

1: First check php.ini, extension=php_openssl.dll whether exist, if present remove the previous annotation character '; ', if it does not exist, then add Extension=php_openssl.dll.

2: Speak php folder under: Php_openssl.dll, Ssleay32.dll, Libeay32.dll 3 files copied to WINDOWSsystem32 folder.

3: Restart Apache or IIS (Iisreset/restart)

At this point, the OpenSSL function is turned on.

Linux to open the method:

I am using Kam still data Cloud host, PHP version: 5.2.14

The following scenario takes my host as an example to add OpenSSL module support for PHP.

Some answers on the internet say you want to recompile PHP, add configure parameters, and increase OpenSSL support. Here is a method that requires no recompilation.

If there is a PHP installation package file on the server best, if deleted, go to download and Phpinfo page display version of the same PHP installation file, I am here php-5.2.14.tar.gz

recommended to Sohu Mirror download, NetEase Mirror did not find. The address is: http://mirrors.sohu.com/php/

Connect to the host with the SSH tool.

. The code is as follows:

# Download to/var/www/php5 directory

Cd/var/www/php5

wget http://mirrors.sohu.com/php/php-5.2.14.tar.gz

# decompression

Tar zxvf php-5.2.14.tar.gz

# Enter PHP's OpenSSL extension Module directory

CD php-5.2.14/ext/openssl/

/var/www/php5/bin/phpize # Here for your own phpize path, if not found, use Whereis phpize to find

# After the execution, found that the error can not find Config.m4, CONFIG0.M4 is config.m4. Direct rename

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

# After the installation is complete, a directory of. so files (openssl.so) is returned. Under this directory, copy the openssl.so file to the extension_dir you specified in php.ini (Find in php.ini file: Extension_dir =), my directory here is var/www/php5/lib/php/ Extensions

# edit php.ini file, add at end of file

Extension=openssl.so

# Restart Apache

/usr/local/apache2/bin/apachectl restart

OK, now you can successfully add OpenSSL support.

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.