When you debug the program today, you are prompted to enable openssl. In most cases, openssl is not enabled. to enable openssl, you need to simply set php to enable openssl, openssl is not enabled in most cases. to enable it, you need to perform simple settings.
How to enable it in windows:
1: first check whether the extension = php_openssl.dll exists in php. ini. If yes, remove the comment ';'. If no such line exists, add extension = php_openssl.dll.
2. copy the php_openssl.dll, ssleay32.dll, and libeay32.dll files in the php folder to the WINDOWS \ system32 \ folder.
3: restart apache or iis (iisreset/restart)
Now, openssl is enabled.
In Linux:
I am using the cloud host of Jinshang data. PHP version: 5.2.14
The following solution uses my host as an example to explain how to add openssl module support for PHP.
Some answers on the Internet are to re-compile PHP, add the configure parameter, and add openssl support. Here is a method that does not need to be re-compiled.
If there is a PHP installation package file on the server, it is best to, if it has been deleted, go to download and phpinfo page shows the version of the same PHP installation file, I here is the php-5.2.14.tar.gz
We recommend that you download the image from Sohu. The Netease Image is not found. Address: http://mirrors.sohu.com/php/
Connect to the host using ssh tools.
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
# Decompress
Tar zxvf php-5.2.14.tar.gz
# Enter the PHP openssl extension module directory
Cd php-5.2.14/ext/openssl/
/Var/www/php5/bin/phpize # Here is your own phpize path. if you cannot find it, use whereis phpize to find it.
# If an error is found after execution, config. m4 cannot be found. config0.m4 is config. m4. Rename directly
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 complete, a directory of the. so File (openssl. so) will be returned. Openssl. so file copy to you in php. under extension_dir specified in ini (in php. in the INI file, find: extension_dir =). The Directory here is var/www/php5/lib/php/extensions.
# Edit the php. ini file and add it at the end of the file
Extension = openssl. so
# Restart Apache.
/Usr/local/apache2/bin/apachectl restart
Now, openssl support is successfully added.