4

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:

Enamul Hassan
  • 5,266
  • 23
  • 39
  • 56
Jaimin
  • 171
  • 1
  • 1
  • 11
  • 4
    Instead of posting a link to an image, please [edit] your question and paste the error text directly into your question. Have you visited [the URL](https://getcomposer.org/doc/06-config.md#secure-http) that Composer recommended? – ChrisGPT was on strike Aug 07 '16 at 21:14
  • Add "secure-http":false to "config" node in composer.json [Here](https://stackoverflow.com/questions/36151172/secure-http-flag-in-a-composer-json-doesnt-work/36152835#36152835) – kn0p1k Aug 02 '18 at 07:01

5 Answers5

14

I have the same issue, but then I try this:

composer config -g secure-http false

then I run again my Laravel, and it works.

Dharman
  • 30,962
  • 25
  • 85
  • 135
6
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

Xiaowei Yang
  • 61
  • 1
  • 3
3

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.

Raymond
  • 1,309
  • 14
  • 10
2

You need to enable OpenSSL in your Windows.

You can enable it from your php.ini file:

extension=php_openssl.dll
  • 2
    Actually, I have installed wamp,xampp and php explicit also. I was giving main php.exe path instead of wamp server php.exe path for composer. I got it. – Jaimin Aug 08 '16 at 04:55
2

Though the topic is pretty old atm, I just ram right into the problem, trying to install an extension using composer for my magento2 application with a network behind the corp. I found the solution myself after combining all of the suggestions I found lately, so here is it. The main task is pretty simple, use HTTP instead of HTTPS for repo.packagist, but we need some configuration in order to make it actually work.

composer clear-cache

composer config -g -- disable-tls true
composer config -g secure-http false
composer config -g repo.packagist composer http://repo.packagist.org

composer require "cadence/heimdall" 
Dharman
  • 30,962
  • 25
  • 85
  • 135
Nidust
  • 599
  • 1
  • 8
  • 16