In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail the solution that php composer can not download the installation package. The editor thinks it is very practical, so I share it with you as a reference. I hope you can get something after reading this article.
Php composer cannot download the installation package: 1, configure the domestic source globally or configure the current project with the domestic source; 2, use the local source of the current project; 3, configure the agent through the command line, and find the server and the port to find its own.
This article operating environment: Windows7 system, PHP7.1 version, DELL G3 computer
Several solutions for composer unable to download the installation package
Why am I slow?
In general, the data of the composer installation package (mainly zip files) is downloaded from github.com.
Due to some unknown reasons, the connection speed of foreign websites is very slow. It doesn't even exist.
Being slow is understandable.
Installation failed now
Solution:
1.1 Global configuration of domestic sources
Enter on the command line
Composer config-g repo.packagist composer https://packagist.phpcomposer.com
Done.
If you don't want to use domestic sources,
Composer config-g-- unset repos.packagist
1.2 current project configuration domestic source
The command line goes to the project composer.json sibling directory (usually the project root directory)
Enter on the command line
Composer config repo.packagist composer https://packagist.phpcomposer.com
It is equivalent to directly modifying composer.json and adding it under repositories.
{"type": "composer", "url": "https://asset-packagist.org"}
Modified result
"repositories": [{/ / I am the previous configuration}, {"type": "composer", "url": "https://asset-packagist.org"}]
There are also small partners to install the project composer.json is purple.
"repositories": {"packagist": {"type": "composer", "url": "https://packagist.phpcomposer.com"}}"
Correct according to the rules
"repositories": [{"type": "composer", "url": "https://packagist.phpcomposer.com"}, {" type ":" composer "," url ":" https://asset-packagist.org"}]
No longer want to use domestic sources
Composer config-unset repos.packagist
Or delete the corresponding added repositories.
It is convenient to use domestic sources, but it is not very stable. Some packages just can't be downloaded.
2 the current project uses a local source
1) first put the downloaded installation package data into a folder. This article takes the composerPackages folder under the same level directory of composer.json as an example.
Generally speaking, after the installation fails directly with composer, there will be a prompt indicating that the download of such and such files failed.
Modify composer.json and add it under repositories
{"type": "path", "url": "composerPackages/*", "options": {"symlink": true}}
The modification is as follows
"repositories": [{/ / I am the previous configuration}, {"type": "path", "url": "composerPackages/*", "options": {"symlink": true}}]
3.1 Command line to configure the agent, find the server and the port to find its own
1.
Command line input
Set http_proxy= proxy address: proxy port
For example, the proxy address is local 127.0.0.1 port 10809
Set http_proxy=127.0.0.1:10809
3.2 add user environment variables to configure the agent
3.3 configure the agent when you install composer
After the agent is configured locally, the corresponding agent is automatically selected. After selecting the agent, composer will verify whether the agent is available.
This is the end of this article on "php composer can not download the installation package solution". I hope the above content can be helpful to you, so that you can learn more knowledge. if you think the article is good, please share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.