【问题标题】:Installing PEAR on Windows 7 using phar使用 phar 在 Windows 7 上安装 PEAR
【发布时间】:2011-06-27 05:25:11
【问题描述】:

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

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

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

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

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

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

【问题讨论】:

    标签: php pear wamp wampserver


    【解决方案1】:

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

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

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

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

    【讨论】:

    • 同上。复制和粘贴源代码不起作用。使用 cURL 直接下载它会给你一个有效的 .phar 文件来安装。
    【解决方案2】:

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

    希望对你有帮助

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

    @圣丹斯

    【讨论】:

    • 这将导致警告说安装的 PHP 版本对于此文件来说太新,您必须返回 phar,它似乎已损坏。
    • 不知道你为什么会收到那个“警告”,我遇到了 Dan Steele 的问题,我可以按照我说的来解决它
    • 也为我工作。我有同样的警告,并用在“pear.php.net/go-pear.phar”找到的最新版本更新“go-pear.phar”文件为我解决了这个问题。
    • 同样的警告,但这个解决方案在 WAMP 2.5 PHP 5.5.12 上没有解决
    【解决方案3】:
    $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);
    

    插入 cmd : php go-pear.phar

    参见: System or local when installing PEAR for PHPUnit http://www.geeksengine.com/article/install-pear-on-windows.html

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-02-23
      • 1970-01-01
      • 2011-06-10
      • 1970-01-01
      • 1970-01-01
      • 2014-01-16
      • 2011-09-10
      • 2021-05-18
      相关资源
      最近更新 更多