php – 使用composer安装PEAR扩展名HTTP_Request2
发布时间:2020-12-13 18:03:30 所属栏目:PHP教程 来源:网络整理
导读:我有一个composer.json文件: { "name": "vendor/Project","description": "description_text","repositories": [ { "type": "pear","url": "http://pear.php.net" } ],"require": { "jakeasmith/http_build_url": "dev-master","phpmailer/phpmailer": "dev
我有一个composer.json文件:
{ "name": "vendor/Project","description": "description_text","repositories": [ { "type": "pear","url": "http://pear.php.net" } ],"require": { "jakeasmith/http_build_url": "dev-master","phpmailer/phpmailer": "dev-master","pear-pear/Text_Diff": "*","pear-pear/Net_IDNA2": "*","pear-pear/HTTP_Request2": "2.2.1" },"require-dev": { "phpunit/phpunit": "< 4.0.0" } } 当我试图执行命令php composer.phar install我得到了这个: Loading composer repositories with package information Initializing PEAR repository http://pear.php.net Installing dependencies (including require-dev) Your requirements could not be resolved to an installable set of packages. Problem 1 - Installation request for pear-pear/http_request2 2.2.1 -> satisfiable by pear-pear.php.net/HTTP_Request2[2.2.1]. - pear-pear.php.net/HTTP_Request2 2.2.1 required pear-pear.php.net/net_url2 >=2.0.0.0 -> no matching package found. Potential causes: - A typo in the package name - The package is not available in a stable-enough version according to your minimum-stability setting see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details. Read <http://getcomposer.org/doc/articles/troubleshooting.md> for further common problems. 为什么我收到错误?我应该将所有pear依赖项存储在我的composer.json文件中以获取HTTP_Request2扩展吗? 附:如果我运行php composer.phar安装 "pear-pear/Archive_Tar": "*","pear-pear/Console_Getopt": "*","pear-pear/Structures_Graph": "*","pear-pear/XML_Util": "*","pear-pear/PEAR": "*","pear-pear/Net_URL2": "*" 然后添加一个字符串:“pear-pear / HTTP_Request2”:“2.2.1”并运行php composer.phar更新 – 一切都像魔术一样!但我不认为这是正确的方法.
通过重命名修复:
"pear-pear/HTTP_Request2": "2.2.1" 至 "pear-pear.php.net/HTTP_Request2": "2.2.1" (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |