Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to find the socket transport "tls" - did you forget to enable it when you configured PHP

Tags:

php

wampserver

I'm using wamp to run, but i got this warning at run time:

Warning: fsockopen() [function.fsockopen]: unable to connect to tls://smtp.gmail.com:465 (Unable to find the socket transport "tls" - did you forget to enable it when you configured PHP?) in C:\wamp\www\mail\testemail.php on line 24 Unable to find the socket transport "tls" - did you forget to enable it when you configured PHP?

like image 769
venu Avatar asked Feb 05 '10 07:02

venu


People also ask

Why isn't TLS enabled by default for WinHTTP?

Earlier versions of Windows, such as Windows 7 or Windows Server 2012, don't enable TLS 1.1 or TLS 1.2 by default for secure communications using WinHTTP. For these earlier versions of Windows, install Update 3140245 to enable the registry value below, which can be set to add TLS 1.1 and TLS 1.2 to the default secure protocols list for WinHTTP.

How do I enable TLS in Configuration Manager?

When enabling TLS 1.2 for your Configuration Manager environment, start by ensuring the clients are capable and properly configured to use TLS 1.2 before enabling TLS 1.2 and disabling the older protocols on the site servers and remote site systems. There are three tasks for enabling TLS 1.2 on clients: Update Windows and WinHTTP

What are the default settings for SSL/TLS in Windows?

By default in Windows, this value is 0x0A0 to enable SSL 3.0 and TLS 1.0 for WinHTTP. The above example keeps these defaults, and also enables TLS 1.1 and TLS 1.2 for WinHTTP.

How do I disable SSL/TLS in SChannel?

If you want to completely disable SSL 3.0 and TLS 1.0, use the SChannel disabled protocols setting in Windows. For more information, see Restrict the use of certain cryptographic algorithms and protocols in Schannel.dll. Ensure that TLS 1.2 is enabled as a protocol for SChannel at the operating system level TLS 1.2 is enabled by default.


2 Answers

You need to enable SSL/TLS for your Apache/PHP installation. Make sure you have libeay32.dll and ssleay32.dll in your /apache/bin folder. Edit your php.ini file and add

extension=php_openssl.dll

Then restart Apache and your SSL should be loaded.

like image 172
Louisvdw Avatar answered Oct 22 '22 23:10

Louisvdw


If you're using WAMP on Windows you can left click on the green W in the notifications pane.

Then goto: PHP -> PHP Extensions -> php_openssl

Once you do that WAMP should auto restart and everything should work.

like image 36
Scott Scanlon Avatar answered Oct 22 '22 23:10

Scott Scanlon