Laravel dependency cannot be retrieved via composer. Alternative for getting L4 source ?

↘锁芯ラ 提交于 2019-12-13 00:07:57

问题


I have a error happening for 2 days now I simply cannot get full L4 source via Composer no matter what I try.

I'm behind Windows 8 & WAMP x64 PHP 5.4 mod_ssl and openssl_module enabled. I tried multiple locations/pc's/networks all throw same error.

http://nodeload.github.com/php-fig/log/zip/fe0936ee26643249e916849d48e3a51d5f5e278b
Following resource cannot be retrived by composer. Here is copy paste out of my terminal:

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
d----          9/6/2013     21:42            app
d----          9/6/2013     21:42            bootstrap
d----          9/6/2013     21:42            public
d----         9/10/2013     00:35            vendor
-a---          9/6/2013     21:42         11 .gitattributes
-a---          9/6/2013     21:42         69 .gitignore
-a---          9/6/2013     21:42       2424 artisan
-a---          9/6/2013     21:42        687 composer.json
-a---         9/10/2013     00:29     799883 composer.phar
-a---          9/6/2013     21:42        145 CONTRIBUTING.md
-a---          9/6/2013     21:42        566 phpunit.xml
-a---          9/6/2013     21:42       1795 readme.md
-a---          9/6/2013     21:42        519 server.php


PS C:\wamp\www> php composer.phar install
Loading composer repositories with package information
Installing dependencies
  - Installing psr/log (1.0.0)
    Downloading: 100%
    Downloading: 100%
    Downloading: 100%



  [Composer\Downloader\TransportException]
  The "http://nodeload.github.com/php-fig/log/zip/fe0936ee26643249e916849d48e3a51d5f5e278b" file could not be downloa
  ded: php_network_getaddresses: getaddrinfo failed: No such host is known.
  failed to open stream: php_network_getaddresses: getaddrinfo failed: No such host is known.



install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-p
rogress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader]

回答1:


First, you should self-update your composer to ensure you are not triggering an already resolved bug.

If that does not change anything, you can fall back to cloning the original repositories instead of downloading a ZIP. Try the composer install with --prefer-source as option and see what happens.

Usually this will avoid the download from the unavailable resource.




回答2:


So I found the solution for this problem:

What causes this exception/error is a redirect from http to https uri. Meaning you need to have MOD_SSL (http.d) and OPENSSL_EXTENSION or PHP_OPENSSL (php.ini) enabled.

What happened in my case was I had a fresh install of WAMP running as always I enabled the OPENSSL extension via WAMP GUI (by left clicking on WAMP icon in try area and then navigating to PHP/Apache settings).

This however only enables OPENSSL for Apache turns out the PHP CLI uses it's own php.ini file and you need to enable the OPENSSL in that one as well.

SOLUTION:
Navigate to your WAMP installation folder */wamp/bin/php(x)/php.ini scroll down to extensions and you fill find a commented line disabling OPENSSL. Uncomment this line and OPENSSL should work for CLI as well.



来源:https://stackoverflow.com/questions/18702081/laravel-dependency-cannot-be-retrieved-via-composer-alternative-for-getting-l4

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