Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Json 在composer不工作的情况下安装laravel依赖项_Json_Laravel_Dependencies_Composer Php - Fatal编程技术网

Json 在composer不工作的情况下安装laravel依赖项

Json 在composer不工作的情况下安装laravel依赖项,json,laravel,dependencies,composer-php,Json,Laravel,Dependencies,Composer Php,我正在尝试使用安装Laravel Excel 我已经在composer.json中包含了这一行 "require": { "laravel/framework": "4.2.*", "maatwebsite/excel": "1.*" }, 然后,我尝试使用命令composer update更新composer。这将导致以下消息 Warning: This development build of composer is over 30 days old. It is reco

我正在尝试使用安装Laravel Excel

我已经在composer.json中包含了这一行

"require": {
    "laravel/framework": "4.2.*",
    "maatwebsite/excel": "1.*"
},
然后,我尝试使用命令
composer update
更新composer。这将导致以下消息

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(如警告消息中建议的那样)时,我得到以下结果:

[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
所以我的第一个问题是我不能更新composer

我的第二个问题是,我认为没有安装Laravel Excel,因为我在vendor/Laravel目录的任何地方都看不到它(这不是所有依赖项通常存储的地方吗?)


当涉及到使用composer和安装依赖项时,我是一个完全的初学者,我以前甚至没有真正使用过JSON文件,直到现在,我在这里非常挣扎…

我曾经遇到过同样的问题。后来,我知道我的代理不允许我更新作曲家。因此,请检查您的代理设置。

对于Linux用户(Centos 6,7) 使用下面的命令检查/etc/resolv.conf中的名称服务器是否正常工作

nslookup www.google.com

如果它不工作,请使用8.8.8.8和8.8.4.4中的google公共名称服务器

nameserver 8.8.8.8
nameserver 8.8.4.4

最好说:你是本地主持人吗?似乎有什么东西阻止了composer访问该网站。如果不是您的本地站点,那么可能是公司防火墙。问题是您的问题误导了读者:确实,由于某些网络问题,您的composer根本无法工作必须运行
composer diagnose
来诊断您或您的网络的任何问题have@Lambrusco它在我的本地主机上。使用公司不受限制的互联网。但是我稍后会在家里再试一次,只是为了确定。@acrobat我得到了检查http连接的
结果:失败
,我认为它在检查composer版本时失败了,并且留下了空白。谢谢你的回答,但请你详细说明/给出回答的步骤。我现在也有类似的问题。@ikuchris转到“Internet属性”并选择“连接”选项卡。单击“Lan设置”并取消选中“为您的Lan使用代理服务器”。