2015-02-06 168 views
0

我試圖使用this guide安裝laravel依賴與作曲家不工作

我已經包含在我的composer.json線安裝Laravel Excel的;

"require": { 
    "laravel/framework": "4.2.*", 
    "maatwebsite/excel": "1.*" 
}, 

我然後嘗試使用命令composer update更新作曲家。這將導致以下消息...。

Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/usr/local/bin/composer self-update" to get the latest version. 

Loading composer repositories with package information 

The "https://packagist.org/packages.json" file could not be downloaded: php_network_getaddresses: getaddrinfo failed: Name or service not known 

failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known 

https://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date 

Updating dependencies (including require-dev) 

[Composer\Downloader\TransportException] 
The "http://packagist.org/p/jeremeamia/functionparser$cac3105ac0ad3f9a0f9c9ccabcde36787c8d8f404a003fa47900f84cee475a34.json" file could not be downloaded: php_ 

network_getaddresses: getaddrinfo failed: Name or service not known 
    failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known 

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN] 

當我嘗試自我更新作曲家(按警告消息中的建議)時,我得到以下內容;

[Composer\Downloader\TransportException] 
    The "https://getcomposer.org/version" file could not be downloaded: php_network_getaddresses: getaddrinfo failed: Name or service not known 
    failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known 

所以我的第一個問題是我不能更新作曲家。

我的第二個問題是,我不認爲Laravel Excel中已經安裝了,因爲我不能看到它的供應商/ laravel目錄的任何地方(是不是說,所有的依賴關係通常存儲?)

我一個完整的初學者,當涉及到使用作曲家和安裝依賴關係,我甚至沒有真正使用JSON文件,直到現在才真正在這裏苦苦掙扎......

+0

更好地說:你在本地主機?似乎有東西阻止作曲家進入該網站。如果它不是您的本地站點,那麼它可能是公司防火牆。 – Lambrusco 2015-02-06 13:21:31

+0

這個問題是你的問題誤導讀者:真的,你的作曲家根本不工作,由於一些淨問題 – Lambrusco 2015-02-06 13:28:21

+0

只需運行'作曲家診斷'來診斷你或你的網絡有任何問題 – acrobat 2015-02-06 13:29:39

回答

2

我曾遇到同樣的問題。後來,我才知道我的代理不允許我更新作曲家。所以,請檢查您的代理設置。

+0

謝謝你回答,但你會詳細說明/給出解答的步驟。我現在有類似的問題。 – ikuchris 2017-02-21 16:18:31

+0

@ikuchris轉到「Internet屬性」並選擇「連接」選項卡。點擊「局域網設置」並取消選中「使用局域網代理服務器」。 – Sivaprakash 2017-02-23 10:31:34

0

對於Linux用戶(Centos的6,7) 檢查你在/etc/resolv.conf裏與下面的命令

Nslookup的www.google.com

如果它工作正常您的域名服務器不工作使用谷歌公共名稱服務器在8.8.8.8和8.8.4.4

nameserver 8.8.8.8 
nameserver 8.8.4.4