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

末鹿安然 提交于 2020-01-30 06:07:50

问题


I am trying to install laravel in my computer.

I am refering to turorails point laravel installation tutorial.

After installing composer trying to create new larael project but getting this error.

This is the error which I am getting:


回答1:


You need to enable OpenSSL in your Windows.

You can enable it from your php.ini file:

extension=php_openssl.dll



回答2:


It works for me, try the step below :

1 First clear the cached

composer clear-cache

2 You have 2 options here:

  1. enable OpenSSL in your php.ini :

    extension=php_openssl.dll

  2. disable TLS SSL option for composer :

    composer config -g -- disable-tls true

3 Run again your laravel project :

composer create-project laravel/laravel your-project-name --prefer-dist

Hope those steps can help you.




回答3:


Step 1: Set disable-tls = true
php composer.phar config -g disable-tls true
Step 2: Set secure-http = false
php composer.phar config -g secure-http false

The reason is: the url of the installation module is not https, reference manual:https://getcomposer.org/doc/06-config.md#disable-tls



来源:https://stackoverflow.com/questions/38818464/configuration-does-not-allow-connection-to-http-packagist-org-packages-json

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!