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.
# Download to/var/www/php5 directory cd/var/www/php5wget http://mirrors.sohu.com/php/php-5.2.14.tar.gz# unzip tar zxvf php-5.2.14.tar.gz # enter PHP openssl extension module directory cd php-5.2.14/ext/openssl // var /www/php5/bin/phpize # Here is your phpize path, if not found, use whereis phpize to find # after execution, the config cannot be found if an error is found. m4, config0.m4 is config. m4. Rename the mv config0.m4 config directly. m4/var/www/php5/bin/phpize. /configure -- with-openssl -- with-php-config =/var/www/php5/bin/php-configmakemake install # After the installation is complete, a message is returned. so File (openssl. so) directory. Openssl. so file copy to you in php. under extension_dir specified in ini (in php. search for extension_dir = in the INI file. the directory here is var/www/php5/lib/php/extensions # Edit php. ini file, add extension = openssl at the end of the file. so # restart Apache to/usr/local/apache2/bin/apachectl restart
Now, openssl support is successfully added.
For more articles about how to enable openssl in php, refer to the Chinese PHP website!