Install PHP-openssl

2018-07-31 09:29:14    Jon    36988

Many SMTP servers now require SSL, and SSL requires PHP to load OpenSSL. This article is to show you how to install OpenSSL on a Linux / Windows system.


About OpenSSL

OpenSSL is a secure socket layer password library, including the main cryptographic algorithms, the common key and certificate encapsulation management functions and the SSL protocol, and provides a rich application for testing or other purposes.


For Linux

1. CentOS

php installation package path:/data/php5.6.14/
PHP installation path:/usr/local/php/



(Set the path according to your actucal situation. Below is an example)

Find the directory of curl in PHP installation package.

cd /data/php5.6.14/ext/openssl/

Rename config0.m4

mv config0.m4 config.m4

Run phpize

/usr/local/php/bin/phpize

Compile and install

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


Now openssl.so is in the directory of /usr/local/php/lib/php/extensions/no-debug-non-zts-20131226/



Add the code below to php.ini

extension=openssl.so



Restart PHP and chech whether PHP-openssl is installed using phpinfo()


2. Ubuntu

Execute

sudo apt-get install openssl
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libssl-dev


Restart Ubuntu


For Windows

1. Check php.ini  whether ; extension=php_openssl.dll exists. If it does, remove the annotate ';'; if not,  add extension=php_openssl.dll.

2 In the PHP folder: copy php_openssl. dll, ssleay32. dll, and libeay32. DLL 3 to WINDOWS\system32\ .

Note: If you don't have php_openssl. dll, download one that fits your PHP version.

3. Restart the service


ZSite8.0