Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

davy_yg's avatar
Level 27

The openssl extension is required for SSL/TLS

After pulling my web with git I get this error message:

   D:\xampp2\htdocs\sesa_final\sesa-e-commerce>composer install


[Composer\Exception\NoSslException]
The openssl extension is required for SSL/TLS protection but is not available. If y
ou can not enable the openssl extension, you can disable this error, at your own ri
sk, by setting the 'disable-tls' option to true.


install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-          autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...

trying to fix it I delete the vendor folder and reinstall it yet still error.

ref: https://stackoverflow.com/questions/35249620/the-openssl-extension-is-required-for-ssl-tls-protection

When I pull the files through tortoise git there is Pull Diff button - which I ignored. Should I press it next time?

0 likes
17 replies
davy_yg's avatar
Level 27

I add :

httpd-vhosts.conf

<VirtualHost *:443>
        DocumentRoot "C:/xampp/htdocs/sesa_final/sesa-e-commerce"
        ServerName www.myurl.com
        SSLEngine on
        SSLCertificateFile "conf/ssl.crt/server.crt" 
        SSLCertificateKeyFile "conf/ssl.key/server.key"
    <Directory "C:/xampp/htdocs/sesa_final/sesa-e-commerce">
     Options All
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

and I already change the root to the project folder:

httpd-ssl.conf

<VirtualHost _default_:443>

#   General setup for the virtual host
DocumentRoot "D:/xampp2/htdocs/sesa_final/sesa-e-commerce"
ServerName http://127.0.0.1:8000:443
ServerAdmin [email protected]
ErrorLog "D:/xampp2/apache/logs/error.log"
TransferLog "D:/xampp2/apache/logs/access.log"

When I run composer install:

D:\xampp2\htdocs\sesa_final\sesa-e-commerce>composer install

[Composer\Exception\NoSslException]
The openssl extension is required for SSL/TLS protection but is not available. If y
ou can not enable the openssl extension, you can disable this error, at your own ri
sk, by setting the 'disable-tls' option to true.


install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-        autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...

See I am developing in localhost through php artisan serve. but the one online using https:// (SSL)

I can't even run composer install (to install my vendor folder back)

thedejavunl's avatar

Do you have extension=openssl enabeled in your PHP.ini?

thedejavunl's avatar

I'm sorry for Windows it is extension=php_openssl.dll. If you do php -v do you get any php errors in your console?

davy_yg's avatar
Level 27

It finally works. A quick question about git - Do you normally pull before you code at the beginning of the day and puss when the code ready to be uploaded

or

pull and push right after your code ready to be uploaded ? Is this the same thing ? Will both works ?

dhuhaal-shaikhli's avatar

@davy_yg - Hi, how did you get it working finally because I did all the suggested methods and still having the same error when trying to create laravel for first time via Git Bash. Many thanks

Kipruto's avatar

Was facing this error

"You must enable the openssl extension in your php.ini to load information from.."

I solved by finding and uncommenting the following lines on php.ini file

;extension=php_openssl.dll

;extension_dir = "ext" in

Wamp/bin/php/php.#.#.###./php.ini

Uncomment both by removing the semicolon (;) from the beginning of each line.

If you have the latest PHP v^8 or above, likely you won't see php.ini file. So what you do is to make a copy of php.ini-development which you will see there and then rename the copy you just made to php.ini and then do the same uncommenting of the two lines then save.

3 likes
Ali01's avatar

@davy_yg

I have this error when making a new project in laravel.

the error :

<< The openssl extension is required for SSL/TLS protection but is not available. If you can not enable the openssl extension, you can disable this error, at your own risk, by setting the 'disable-tls' option to true. >>

After troubleshooting I found that the reason was that I had downloaded a new version of php and added it to the machine environment paths.

I solved it by removing this version from environment paths and making a new path to the version that was associated with laragon.

So I ask "was the error for the type of php that I have downloaded recently 'thread or non thread'? OR was it for something related to laragon and xampp as wamp servers or what ?? "

jlrdw's avatar

Maybe take some of the github tutorials.

Tray2's avatar

Depends on how you want to work.

If it's only you on the project you can do a pull in the morning then work for 8 hours and then do a push or you can do a pull in the morning then for every added functionality you do a push when all the tests are passing. Never push code that has a failing test.

This is how I work with git.

  1. If needed pull the code from Github.
  2. Write the first test for the new feature
  3. Make the test pass
  4. Commit the changes to my local git repository.
  5. Repeat steps 2-3 until the added feature is completed.
  6. Push the changes to Github.

There is a good course here https://laracasts.com/series/git-me-some-version-control

davy_yg's avatar
Level 27

If only me in the project why would I even need to pull since no one else add something to the codes?

pull and push codes at the end of the day after I write a new feature to push is fine too right?

Sinnbeck's avatar

Sure, unless you need to push a hotfix instantly. And yes if you are the only developer you probably never need to pull (unless using multiple computers)

Daniel-Pablo's avatar

--------- AM ON WINDOWS 10 ----- Hi , I want to give a stupid solution... but some one can run into it, after trying to update to PHP 7.4.10 the last version, I uncomment and made A LOT OF THINGS... I was reading the files inside the PHP and just came out that there wasent a php.ini file so I copy the file called

php.ini-development -> to php.ini make a copy // I DID NOT HAVE THAT FILE!!! check your folder!!

copy and paste and rename it to php.ini ---------- this file was the one I modify , after that I re run all and that make the magic :) so --------- AM ON WINDOWS 10 ----- HOPE SOME ONE HELPS THIS

3 likes
aiman.asfia@gmail.com's avatar

@Arius Tigger It worked for me. I spent three days on this, and in the end, I came across your solution. Thanks

thiagoguimmaraess's avatar

@Arius Tigger It might be a stupid solution but you saved me hours, days! I was trying so hard, racking my brains without realizing the default php.ini-development or php.ini-production files have no effect. Only now, seeing your comment, I could realize my mistake, having tried to uncomment the extension in both files still, not working. I simply copied, pasted and changed its name. Thank you!

Please or to participate in this conversation.