Enabling the OpenSSL in XAMPP

眉间皱痕 提交于 2019-11-26 14:28:38
Memochipan

Yes, you must open php.ini and remove the semicolon to:

;extension=php_openssl.dll

If you don't have that line, check that you have the file (In my PC is on D:\xampp\php\ext) and add this to php.ini in the "Dynamic Extensions" section:

extension=php_openssl.dll
[PHP_OPENSSL]
extension=php_openssl.dll

This is the answer.

In xampp, if "extension=php_openssl.dll" is not present in your php.ini file then add it in the "Windows Extensions" section of your php.ini file and restart your apache. It works for me..

I use xampp. Beforehand I tried the example file "test_smtp_gmail_basic.php" in phpMailer (you can download phpMailer here: https://github.com/Synchro/PHPMailer), but I got the following error:

Mailer Error: The following From address failed: xxx@gmail.com

After I commented out ; extension=php_openssl.dll in php.ini, it is working now.

You will need to edit your php.ini. It's 4 easy steps.

Find your php.ini file.

$inipath = php_ini_loaded_file();

Enable openssl in the file:

extension=php_openssl.dll 

Turn allow_url_fopen on

allow_url_fopen = On

Restart apache and you are done!

Things have changed for PHP > 7. This is what i had to do for PHP 7.2.

Step: 1: Uncomment extension=openssl

Step: 2: Uncomment extension_dir = "ext"

Step: 3: Restart xampp.

Done.

Explanation: ( From php.ini )

If you wish to have an extension loaded automatically, use the following syntax:

extension=modulename

Note : The syntax used in previous PHP versions (extension=<ext>.so and extension='php_<ext>.dll) is supported for legacy reasons and may be deprecated in a future PHP major version. So, when it is possible, please move to the new (extension=<ext>) syntax.

Special Note: Be sure to appropriately set the extension_dir directive.

STEP 1: On your php.ini comment out ;extension=php_openssl.dll

STEP 2: Copy libeay32.dll and ssleay32.dll from your PHP root folder and paste it your Apache/bin folder

STEP 3: Restart Apache

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!