php 使用 phar 在 Windows 7 上安装 PEAR

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4997628/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-25 16:30:19  来源:igfitidea点击:

Installing PEAR on Windows 7 using phar

phppearwampwampserver

提问by Dan Steele

I'm trying to install PEAR for use with Wamp 2.1. The package does not come with any pear installation. I have read that you need to use http://pear.php.net/go-pear.pharto install PEAR for PHP 5.3 as the old go-pear.bat is now obsolete?

我正在尝试安装 PEAR 以与 Wamp 2.1 一起使用。该软件包不附带任何梨形安装。我读到您需要使用http://pear.php.net/go-pear.phar为 PHP 5.3 安装 PEAR,因为旧的 go-pear.bat 现在已经过时了?

The instructions are to run the following command to install PEAR;

说明是运行以下命令来安装 PEAR;

php -d phar.require_hash=0 PEAR/go-pear.phar

However, this is resulting in the following error;

但是,这会导致以下错误;

manifest cannot be larger than 100 MB in phar "D:\wamp2\bin\php\php5.3.4\PEAR\go-pear.phar"

I'm sure this is due to a php setting I have correct somewhere, anyone have any ideas?

我确定这是由于我在某处正确设置的 php 设置,有人有任何想法吗?

回答by Flion

Even with "save as" directly from the browser I got the same error. The solution for me was to download it directly through the command line:

即使直接从浏览器“另存为”,我也遇到了同样的错误。我的解决方案是直接通过命令行下载它:

cd C:/php/bin/
curl -OL http://pear.php.net/go-pear.phar

this properly downloaded the .phar file and after the installation properly started with:

这正确下载了 .phar 文件,并在安装正确开始后:

php -d phar.require_hash=0 go-pear.phar

回答by Sundance

I do. You are copying all the text and if you see at the bottom are some ASCII characters making the file bad.

我愿意。您正在复制所有文本,如果您在底部看到一些 ASCII 字符,会使文件变坏。

Hope i helped you

希望我能帮到你

Edit: you have to Download the file go-pear.phar from http://pear.php.net/go-pear.pharuse some download manager then save as go-pear.phar into WampDir\php\PEAR\go-pear.phar

编辑:您必须从http://pear.php.net/go-pear.phar下载文件 go-pear.phar使用一些下载管理器,然后将 go-pear.phar 保存为 WampDir\php\PEAR\go-梨形

@Sundance

@圣丹斯

回答by mohammad emami

$file = 'http://pear.php.net/go-pear.phar';
$file2 = 'C:\wamp\bin\php\php5.5.12\go-pear.phar';
// Open the file to get existing content
$current = file_get_contents($file);
// Write the contents back to the file

file_put_contents($file2, $current);

insert into cmd : php go-pear.phar

插入cmd:php go-pear.phar

see alse : System or local when installing PEAR for PHPUnithttp://www.geeksengine.com/article/install-pear-on-windows.html

另请参阅: 为 PHPUnit http://www.geeksengine.com/article/install-pear-on-windows.html安装 PEAR 时的系统或本地