简体   繁体   中英

Unable to install Laravel via Composer

I'm getting an error while trying to install Laravel using Composer. I also had the same problem trying to install composer itself, was getting "Connection Timed-out", so I had to download composer.phar manually. I'm using Fedora 23. Here's my input:

composer create-project laravel/laravel project

and the error i'm getting:

    [Composer\Downloader\TransportException]                                                                             
  The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Connection timed out

My internet is working fine and I'm not using proxy. What could be the issue? Thanks.

Try locating the cacert.pem file(console: locate cacert.pem ) and add this to your php.ini

openssl.cafile= the cacert.pem path

so for example the path is /usr/local/share/perl5/Mozilla/CA/cacert.pem then add the following line to your php.ini

openssl.cafile=/usr/local/share/perl5/Mozilla/CA/cacert.pem;

I'm extremely sorry for wasting your time guys. I realized I'm the one who was wrong. A few days ago I was working somewhere and I was required to change my proxy settings. Now my browser was still working fine when I got back but any download from the terminal was timing out. Just changed proxy to "None" and everything is working fine. Thank you very much for your suggestions. I appreciate.

如果再次遇到网络或安全问题,请在安装Laravel之前强制作曲家使用https下载所有依赖项

 composer config -g repo.packagist composer https://packagist.org 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM