Php – Unable to find the socket transport “tls” – did you forget to enable it when you configured PHP

phpwampserver

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?

Best Solution

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.