How to install openssl extension in php

藏色散人
Release: 2023-03-06 21:28:01
Original
3702 people have browsed it

How to install openssl extension in php: first find the curl extension directory in the PHP installation package; then rename the config0.m4 file; then run phpize; finally compile and install, and set the PHP configuration file php.ini. Can.

How to install openssl extension in php

Recommended: "PHP Video Tutorial"

About openssl

OpenSSL is a Secure Socket Layer cryptographic library that includes major cryptographic algorithms, common key and certificate encapsulation management functions, and SSL protocols, and provides a rich set of applications for testing or other purposes.

Installing openssl extension

linux system article

1.CentOS system

php installation package directory:/data/php5. 6.14/

PHP installation path: /usr/local/php/

(The specific path settings in the following steps can be set according to your actual situation.)

Find the curl extension directory in the PHP installation package

cd /data/php5.6.14/ext/openssl/
Copy after login

Rename the config0.m4 file

mv config0.m4 config.m4
Copy after login

Run phpize

/usr/local/php/bin/phpize
Copy after login

Compile and install:

./configure --with-openssl --with-php-config=/usr/local/php/bin/php-config make && make install
Copy after login

This At that time, openssl.so has been generated in the /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/ directory

Set the PHP configuration file php.ini, add the following One line

extension=openssl.so
Copy after login

Finally restart the service and use phpinfo() to check whether the PHP-openssl extension is installed successfully.

2.Ubuntu system

Execute the following command:

sudo apt-get install openssl sudo apt-get install libcurl4-openssl-dev sudo apt-get install libssl-dev
Copy after login

Finally restart the service.

Windows System Chapter

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

2: Let’s talk about the three files in the php folder: php_openssl.dll, ssleay32.dll, libeay32.dll and copy them to the WINDOWS\system32\ folder.

Note: If there is no php_openssl.dll, go to the Internet to download one. There are many php_openssl downloads. Find the php_openssl under your corresponding PHP version.

3: Restart the service

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

Related labels:
source:php.cn
Statement of this Website
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
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!