Ramasubramaniam R
Ramasubramaniam R

Reputation: 69

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

<?php
$fp = fsockopen("tls://smtp.gmail.com", 465, $errno, $errstr, 30);
if (!$fp) {
   echo "ERROR: $errno - $errstr<br />\n";
          } else {
   echo "opened";
         } 
?>

While I am running this file getting the error in browser : 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:\AppServ\www\test1\tls.php on line 3 ERROR: 71756200 - Unable to find the socket transport "tls" - did you forget to enable it when you configured PHP?

Upvotes: 2

Views: 1569

Answers (1)

hjpotter92
hjpotter92

Reputation: 80639

Open your PHP configuration file (php.ini) and see if the openssl extension is enabled there or not.

The statement generally appears as follows:

extension=php_openssl.dll

Confirm the same with the output of phpinfo().

Upvotes: 1

Related Questions