Home >Backend Development >PHP Tutorial >Detailed explanation of steps to install openssl extension in php7

Detailed explanation of steps to install openssl extension in php7

php中世界最好的语言
php中世界最好的语言Original
2018-05-18 09:56:121549browse

This time I will bring you php7Detailed explanation of the installation openssl extension steps, what are the precautions for installing openssl extension in php7, the following is a practical case, Let’s take a look.

1. My source code is in /home/topsec/Documents/php-7.0.11, the installation location is in /usr/local/php7, and php.ini is in /usr/local /php7/lib. If there is no php.ini, you need to rename the configuration file php.ini-development or php.ini-production in the source code to php.ini and put it under lib.

2. Enter the extension directory of openssl: /home/topsec/Documents/php-7.0.11/ext/openssl

3. Run phpize

/usr/local/php7/bin/phpize

4. Execute Installation

./configure --with-openssl --with-php-config=/usr/local/php7/bin/php-config 
make&&make install

5. During the process, libssl may not be found. Execute the following command and then execute it again. 4. Execute installation

yum install openssl 
yum install openssl-devel

6. After executing the installation, you will be prompted to generate a directory in a certain directory. .so file, the location I generated is under /usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/

7. Open php.ini

vim /usr/local/php7/lib/php.ini

Add the following two sentences

extension_dir = "/usr/local/php7/lib/php/extensions/no-debug-non-zts-20151012/" 
extension=openssl.so

8. Restart php.

I believe you have mastered the method after reading the case in this article. For more exciting information, please pay attention to other related articles on the php Chinese website!

Recommended reading:

Detailed explanation of the steps to implement public key encryption using PHP openssl extension

Detailed explanation of the security verification steps for PHP development api interface

The above is the detailed content of Detailed explanation of steps to install openssl extension in php7. 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