Home  >  Article  >  Backend Development  >  What is the method to enable openssl in php

What is the method to enable openssl in php

青灯夜游
青灯夜游Original
2021-09-18 14:43:214668browse

Method: 1. Remove the ";" before the "extension=php_openssl.dll" item in the configuration file; 2. Copy "php_openssl.dll", "ssleay32.dll" and other files to "WINDOWS\ system32" directory; 3. Restart the server.

What is the method to enable openssl in php

The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer

PHP After entering the 7.x era, the default It will no longer come with the mcrypt extension, and mcrypt will be replaced by the openssl_* family of functions. Therefore, for PHPer, it is necessary to learn the OpenSSL extension of PHP.

OpenSSL is a set of encryption tools for the SSL/TLS protocol. Its functions are:

  • Generate private keys.

  • Generate a certificate, a digital signature certificate, which contains a public key and can be used to encrypt and decrypt data in one direction. That is, data encrypted using the public key can only be decrypted using the private key. Data encrypted using the private key can be decrypted using the public key.

  • Calculate information summary.

  • SSL/TLS client and server side testing.

  • Handles S/MIME tags and encryption of messages.

So how to enable openssl extension in php? Here's how to do it.

In most cases openssl is not turned on. To enable it, you need to make the following simple settings:

1: First check the ;extension in the configuration file php.ini =php_openssl.dll exists. If it exists, remove the preceding comment character ';'. If this line does not exist, add extension=php_openssl.dll.

2: Copy the 3 files in the php folder: php_openssl.dll, ssleay32.dll, libeay32.dll to WINDOWS\system32\ folder.

3: Restart apache or iis server

At this point, the openssl function is enabled.

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What is the method to enable openssl in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn