作曲家:无法创建新项目

I am studying Laravel now. I am going to create new project using composer. I am using Window 7 and XAMPP. I have tried command "composer create-project laravel/laravel cats --prefer-dist". But I have got error as following:

C:\Users\Administrator\Documents\Laravel>composer create-project laravel/laravel


cats --prefer-dist





[Composer\Downloader\TransportException]
  The "https://packagist.org/packages.json" file could not be downloaded: SSL
   operation failed with code 1. OpenSSL Error messages:
  error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol
  Failed to enable crypto
  failed to open stream: operation failed



create-project [-s|--stability="..."] [--prefer-source] [--prefer-dist] [--repos
itory-url="..."] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--n
o-scripts] [--no-progress] [--keep-vcs] [--no-install] [--ignore-platform-reqs]
[package] [directory] [version]



C:\Users\Administrator\Documents\Laravel>

I have set HTTP_PROXY and HTTPS_PROXY.

Now what can I do to solve this problem. Please help me.

Thanks.

In your composer.json file in "config" clause, add this line

"config": {
        "HTTPS_PROXY_REQUEST_FULLURI" : "false",
        "HTTP_PROXY_REQUEST_FULLURI" : "false"
    },

I have solved this problem.

I have set the environment variable as following:

HTTP_PROXY=http://my.proxy.com:port

HTTPS_PROXY=http://my.proxy.com:port (same as above)

And download cert.pem file and set it as openssl.cafile in php.ini as following:

openssl.cafile="C:\xampp\php\cert.pem"

Then it works fine.

Thanks for help.