unable to find socket transport ssl

How to Fix “Unable to find socket transport SSL” error in PHP

Sometimes, while running PHP websites, you may get an error “Unable to find socket transport SSL…” message. It relates to HTTPS/SSL web pages and openssl library. In this article, we will look at how to fix this problem.


How to Fix “Unable to find socket transport SSL” error in PHP

It is easy to fix this problem. Just open php.ini file in a text editor.

$ sudo vi /etc/php/x.y/apache2/php.ini

In above command, x.y is the version of your PHP, for example, 5.6, 5.7, etc. In windows, php.ini is generally located at C:\PHP\php.ini.

In both cases (LInux or Windows), if you are unable to find php.ini file, then just create a simple php file (php_info.php) with the following code and save it at the root folder of your website (/var/www/html/php_info.php)

<?php phpinfo(); ?>

Open web browser and go to http://localhost/php_info.php. You will see an output as shown below.

Scroll down to “Loaded Configuration File” value. It will give you the location of php.ini file.

Look for the following line.

;extension=php_openssl.dll

Uncomment it by removing ; at its beginning.

extension=php_openssl.dll

Also ensure that php_openssl.dll is in one of the folders in Linux PATH variable so that it is easily found. You can easily view the PATH value with following command.

$ echo $PATH

If you are on windows, then copy php_openssl.dll file to C:\windows or C:\windows\system32 where it can be found easily by the system.

That’s it. We have learnt how to fix “Unable to find socket transport SSL” error in PHP.

Also read:

How to Enable Error Reporting in PHP
How to Redirect URL/Page with Anchor Link
How to Convert Docx to PDF in Python
How to Setup SSH Passwordless Login
How to Change NGINX User

Leave a Reply

Your email address will not be published.