[php] Socket transport "ssl" in PHP not enabled

I'm having trouble enabling the socket transport "ssl" in PHP. When I run my script, I get the error:

Warning: fsockopen() [function.fsockopen]: unable to connect to ssl://www.my.site.com:443 (Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?)

I'm running IIS6 on Windows and this is what I've done so far to try to get it working:

  • uncommented the php_openssl.dll and php_sockets.dll extensions in php.ini
  • made sure PHP was loading the ini file I made changes to (it is, and it's definitely loading other extensions, so I'm fairly sure this isn't the problem)
  • made sure php_openssl.dll and php_sockets.dll were in the correct location
  • copied ssleay32.dll and libeay32.dll to the main PHP folder, the WINDOWS folder and the WINDOWS/system32 folder
  • made sure the Windows path variable included the location of PHP
  • made sure the file permissions were correct on all the relevant files.

I've restarted IIS after pretty much every change, but I haven't had any luck. Is there anything obvious that I'm doing wrong? Is there anyway to troubleshoot this in smaller parts? (So I can figure out the problem by the process of elimination...?)

Unfortunately Windows/IIS aren't my area of expertise--I've been put in charge because nobody else seems to know anything.

This question is related to php ssl iis-6 fsockopen

The answer is


Success!

After checking the log files and making sure the permissions on php_openssl.dll were correct, I googled the warning and found more things to try.

So I:

  • added C:\PHP\ext to the Windows path
  • added libeay32.dll and ssleay32.dll to C:\WINDOWS\system32\inetsrv
  • rebooted the server

I'm not sure which of these fixed my problem, but it's definately fixed now! :)

I found these things to try on this page: http://php.net/manual/en/install.windows.extensions.php

Thanks for your help!


In XAMPP Version 1.7.4 server does not have extension=php_openssl.dll line in php ini file. We have to add extension=php_openssl.dll in php.ini file


Just uncomment extension=php_openssl.dll Restart Apache Service and that should help.


Ran into the same problem on Laravel 4 trying to send e-mail using SSL encryption.

Having WAMPServer 2.2 on Windows 7 64bit I only enabled php_openssl in the php.ini, restarted WAMPServer and worked flawlessly.

Did following:

  • Click WampServer -> PHP -> PHP extensions -> php_openssl
  • Restart WampServer

I was having problem in Windows 7 with PHP 5.4.0 in command line, using Xampp 1.8.1 server. This is what i did:

  1. Rename php.ini-production to php.ini (in C:\xampp\php\ folder)
  2. Edit php.ini and uncomment extension_dir=ext.
  3. Also uncomment extension=php_openssl.dll.

After that it worked fine.


I am using XAMPP and came across the same error. I had done all those steps, added environmental variables path, copied the dll's every directory possible, to /php, /apache/bin, /system32, /syswow64, etc.. but still got this error.

Then after checking the apache error log, I noticed the issue with using brackets in path.

PHP: syntax error, unexpected '(' in C:\Program Files (other)\xampp\php\php.ini on line 707 0 server certificate does NOT include an ID which matches the server name

If you have installed the server in "Program Files (x86)" directory, the same error might occur due to the non-escaped brackets.

To fix this, open php.ini file and locate the line containing "include_path" and enclose the path with double quotes to fix this error.

include_path="C:\Program Files (other)\xampp\php\PEAR"


I also ran into this issue just now while messing with laravel.

I am using wampserver for windows and had to copy the /bin/apache/apacheversion/bin/php.ini file to /bin/php/phpversion/php.ini


Examples related to php

I am receiving warning in Facebook Application using PHP SDK Pass PDO prepared statement to variables Parse error: syntax error, unexpected [ Preg_match backtrack error Removing "http://" from a string How do I hide the PHP explode delimiter from submitted form results? Problems with installation of Google App Engine SDK for php in OS X Laravel 4 with Sentry 2 add user to a group on Registration php & mysql query not echoing in html with tags? How do I show a message in the foreach loop?

Examples related to ssl

Requests (Caused by SSLError("Can't connect to HTTPS URL because the SSL module is not available.") Error in PyCharm requesting website A fatal error occurred while creating a TLS client credential. The internal error state is 10013 curl: (35) error:1408F10B:SSL routines:ssl3_get_record:wrong version number How to install OpenSSL in windows 10? ssl.SSLError: tlsv1 alert protocol version Invalid self signed SSL cert - "Subject Alternative Name Missing" "SSL certificate verify failed" using pip to install packages ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:749) Powershell Invoke-WebRequest Fails with SSL/TLS Secure Channel "ssl module in Python is not available" when installing package with pip3

Examples related to iis-6

How to allow download of .json file with ASP.NET IIS Request Timeout on long ASP.NET operation Mailbox unavailable. The server response was: 5.7.1 Unable to relay for [email protected] Login failed for user 'DOMAIN\MACHINENAME$' Socket transport "ssl" in PHP not enabled What causes an HTTP 405 "invalid method (HTTP verb)" error when POSTing a form to PHP on IIS? How to redirect a URL path in IIS? What does 'IISReset' do?

Examples related to fsockopen

How to check if a file exists from a url php_network_getaddresses: getaddrinfo failed: Name or service not known Socket transport "ssl" in PHP not enabled