2

I just imported a Symfony project from GitHub to Intellij IDEA. I used the usual method : https://www.jetbrains.com/help/phpstorm/2016.2/cloning-a-repository-from-github.html

Now I want to update composer and start working. But when I type the command line :

composer update

I got this error :

your configuration does not allow connections to http://packagist.org/packages.json...

And I can't continue. Please where I'm wrong ?

kabrice
  • 1,475
  • 6
  • 27
  • 51
  • Possible duplicate ? http://stackoverflow.com/questions/38818464/configuration-does-not-allow-connection-to-http-packagist-org-packages-json – Delphine Nov 18 '16 at 14:54

2 Answers2

1

Newer versions of Composer do not allow connections via unsecured HTTP anymore by default:

Defaults to true. If set to true only HTTPS URLs are allowed to be downloaded via Composer. If you really absolutely need HTTP access to something then you can disable it, but using Let's Encrypt to get a free SSL certificate is generally a better alternative.

Source


To resolve this, make sure to use HTTPS to connect to the repositories, or change your Composer config.

TimoStaudinger
  • 41,396
  • 16
  • 88
  • 94
  • Thx for answering, but how to make sure I used HTTPS to connect to the repository because I used https://github.com/kabrice/3iSchool.git to get connected, and it's secure. Is there other way ? – kabrice Nov 17 '16 at 18:44
0

If your resource URL is secured (using ssl) add https:// in front of your URL.

If you want to allow not secured connection add:

"config": {
"secure-http": false
},

in your composer.json

warning: Please note that is always a good practice to use ssl certificates and allow only secured connections.