Home  >  Article  >  Backend Development  >  How to enable openssl in php_PHP tutorial

How to enable openssl in php_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:29:48919browse

How to enable openssl in php. In most cases, openssl is not enabled. To enable it, you need to make simple settings

How to enable it in windows:

1: First check whether extension=php_openssl.dll exists in php.ini. If it exists, remove the previous comment character ';'. If this line does not exist, add extension=php_openssl.dll.
2: Copy php_openssl.dll, ssleay32.dll, libeay32.dll 3 files in the php folder to the WINDOWSsystem32 folder.
3: Restart apache or iis (iisreset /restart)

At this point, the openssl function is enabled.

How to enable it under Linux:

I am using the cloud host of Jinshang Data, PHP version: 5.2.14
The following plan uses my host as an example to explain how to add openssl module support to PHP.
Some answers on the Internet say that you need to recompile PHP, add configure parameters, and add openssl support. Here is a method that does not require recompiling.
It is best if the PHP installation package file exists on the server. If it has been deleted, download the PHP installation file with the same version as shown on the phpinfo page. Here is php-5.2.14.tar.gz
It is recommended to go to Sohu Mirror Download, NetEase mirror not found. The address is: http://mirrors.sohu.com/php/
Use the ssh tool to connect to the host.

Copy the code The code is 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 PHP's openssl extension module directory
cd php-5.2.14/ext/openssl/
/var/www/php5/bin/phpize # Here is your own phpize path, if not found, use whereis phpize search
# After execution, an error was found that config.m4 could not be found. config0.m4 is config.m4. Directly 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 completed, a directory of .so files (openssl.so) will be returned. Copy the openssl.so file in this directory to the extension_dir you specified in php.ini (find: extension_dir = in the php.ini file). My directory here is var/www/php5/lib/php/extensions
# Edit the php.ini file and add
extension=openssl.so at the end of the file
# Restart Apache
/usr/local/apache2/bin/apachectl restart

Okay, openssl support is now successfully added.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/770577.htmlTechArticleHow to enable openssl in php. In most cases, openssl is not enabled. To enable it, you need to do the following simple steps Set up the opening method under windows: 1: First check php.ini; extensi...
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