close

[Solved] Composer not working on windows, gives [Composer\Exception\NoSslException] error

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error Composer not working on windows, gives [Composer\Exception\NoSslException] error in php. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How Composer not working on windows, gives [Composer\Exception\NoSslException] error Error Occurs?

Today I get the following error Composer not working on windows, gives [Composer\Exception\NoSslException] errorin php.

How To Solve Composer not working on windows, gives [Composer\Exception\NoSslException] error Error ?

  1. How To Solve Composer not working on windows, gives [Composer\Exception\NoSslException] error Error ?

    To Solve Composer not working on windows, gives [Composer\Exception\NoSslException] error Error Find the php.ini which corresponds to where you issue the command from.

  2. Composer not working on windows, gives [Composer\Exception\NoSslException] error

    To Solve Composer not working on windows, gives [Composer\Exception\NoSslException] error Error Find the php.ini which corresponds to where you issue the command from.

Solution 1


I had the same issue. I did the following things to make sure the composer works out.

  • Find the php.ini which corresponds to where you issue the command from.

php --ini

sample output before correction:

Configuration File (php.ini) Path: C:\WINDOWS
Loaded Configuration File:         (none)
Scan for additional .ini files in: (none)
Additional .ini files parsed:      (none)

This C:\WINDOWS here is a hoax. When I looked in the php installation directory, I found out there is NO php.ini. There are two files php.ini-development and php.ini-production. Just rename one to php.ini

Then you should see the correct ini path when you do php --ini

  • Set the extensions directory

Afterwards, open the php.ini file and uncomment the following line ;extension_dir = "ext" should be

extension_dir = "ext"
  • Enable extensions

Then uncomment the extensions the same way. The following are usually required. (But please find out what you need from the messages you see from composer commands)

extension=fileinfo
extension=gd2
extension=mbstring
extension=openssl

Solution 2

I was running php7.2.x on my Windows 10 machine before I upgraded to PHP 7.4.10 (cli)

When I first pulled up the php.ini file, to my surprise, it was empty.

To be sure that I was looking at the right file, I did

php --ini

I was looking at the correct file.

I looked at the php folder of XAMPP and noticed two files:

  1. php.ini-production.ini
  2. php.ini-development.ini

I copied the contents of the first file and pasted in my php.ini file. Then after a restart, I saw a ton of other modules were not being loaded.

I then went in to my php.ini file’s Dynamic Extensions sections and had to uncomment all the following extensions:

extension=bz2
extension=curl
extension=ffi
extension=ftp
extension=fileinfo
extension=gd2
extension=gettext
extension=gmp
extension=intl
extension=imap
extension=ldap
extension=mbstring
extension=exif      ; Must be after mbstring as it depends on it
extension=mysqli
extension=oci8_12c  ; Use with Oracle Database 12c Instant Client
extension=odbc
extension=openssl
extension=pdo_firebird
extension=pdo_mysql
extension=pdo_oci
extension=pdo_odbc
extension=pdo_pgsql
extension=pdo_sqlite
extension=pgsql
extension=shmop

And then restarted Apache server agan, after saving my php.ini file.

This time, everything worked!

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read

Leave a Comment