【问题标题】:Windows - PHPDocs unable to install through PearWindows - PHPDocs 无法通过 Pear 安装
【发布时间】:2015-08-02 05:36:13
【问题描述】:

运行两个命令安装phpdocs时:

pear channel-discover pear.phpdoc.org pear install

phpdoc/phpDocumentor

我在下面收到这个错误,说我无法解压下面的 tgz 文件。

C:\wamp\bin\php\php5.5.12\pear>pear channel-discover pear.phpdoc.org
            
C:\wamp\bin\php\php5.5.12\pear>pear install phpdoc/phpDocumentor
downloading phpDocumentor-2.8.2.tgz ...
Starting to download phpDocumentor-2.8.2.tgz (16,246,834 bytes)
            ................................................................................
            ................................................................................
            ................................................................................
..........................done: 16,246,834 bytes
ERROR: unable to unpack C:\Users\me\AppData\Local\Temp\pear\download\p
            hpDocumentor-2.8.2.tgz

【问题讨论】:

    标签: php wamp pear


    【解决方案1】:

    看起来 PEAR 安装程序由于某种原因无法解压缩下载的 .tgz,例如可能没有编译 zlib 扩展。

    作为一种解决方法,您可以指定 PEAR 应改为请求未压缩的包文件:

    pear install --nocompress phpdoc/phpDocumentor
    

    【讨论】:

    • 不工作没有。虽然 tarball 是未压缩的罚款。有没有办法安装解压包?
    • 是的。这是如何“手动”完成的:您需要将包解压缩到一个临时目录,如果需要,可以将其命名为 uncompressedpackagedir。在 uncompressedpackagedir 中,您将看到一个 package.xml,您需要将其复制或移动到以您提取的包命名的新创建目录中。对于 phpDocumentor v2.8.2,它将被命名为 phpDocumentor-2.8.2。 cd 进入该目录并执行“$ sudo pear installl package.xml”。
    【解决方案2】:

    遇到同样的问题,原来 2.8.2 的包有问题,因为 pear install phpdoc/PhpDocumentor-2.8.1 工作得很好

    【讨论】:

    • 这个信息对我帮助很大。当只有 phpdoc 包真的有问题时,我试图弄清楚我的 pear 安装的问题是什么
    • 我认为您的设置可能有问题,因为我能够毫无问题地安装 2.8.2。
    【解决方案3】:

    我试过@kguest 答案->

      pear install --nocompress phpdoc/phpDocumentor
    

    没有运气。所以我尝试“升级”

     pear upgrade C:\Users\xxxxx\AppData\Local\Temp\pear\download\phpDocumentor-2.8.2.tar
    

    再次,没有运气。然后我构建自己的解决方案:

    1) 从 PEAR 临时目录中提取文件:

      C:\Users\xxxxx\AppData\Local\Temp\pear\download\phpDocumentor-2.8.2.tar
    

    2) 将最近解压的文件重新打包为 TAR(我使用的是 7zip)。

    3) 从新创建的 TAR 重新尝试升级:

      C:\temp\phpDocumentor.tar
    

    然后它才起作用。

    【讨论】:

      【解决方案4】:

      我对 phpDocumentor 2.8.5 的解决方案是

      1. 从以下位置下载 tarball 存档 https://github.com/phpDocumentor/phpDocumentor2/releases

      2. 解压压缩包phpDocumentor-2.8.5.tgz手动(例如用7zip)你会得到phpDocumentor-2.8.5.tar,解压它你也会得到文件夹 phpDocumentor-2.8.5 和文件 package.xml

      3. 编辑存档 package.xml 并将文本 template:init 更改为 template_init(第 2036 行)实际上是一条路径(信息来源:https://github.com/phpDocumentor/phpDocumentor2/issues/1608

      4. 压缩文件夹phpDocumentor-2.8.5和文件package.xml(例如phpdoc285.tar

      5. 安装存档phpdoc285.tar

        pear install --nocompress phpdoc285.tar

      【讨论】:

      • 我现在收到错误消息:pear install "C:\Users\xxxxxxxxxx\AppData\Local\Temp\pear\download\phpDocumentor-2.8.5.tar" 错误:文件 C:\xampp \php\tmp\tmp7F1F.tmp\phpDocumentor-2.8.5\ansible\roles\phpdocumentor.environment\handlers\main.yml 不存在
      【解决方案5】:

      在尝试其他人的解决方案几个小时后,我终于可以使用 phpDocumentor 2.9.0

      您可以从以下网址下载:

      https://github.com/phpDocumentor/phpDocumentor2/releases

      然后使用 pear install "filepath\phpDocumentor-2.9.0.tgz"

      【讨论】:

        【解决方案6】:

        这个问题特别是在windows操作系统上,以避免错误:

        错误:无法解压...

        在启动 phpdoc 命令之前安装 7-zip

        【讨论】:

          猜你喜欢
          • 2011-09-10
          • 2010-11-29
          • 2011-09-29
          • 2015-12-01
          • 2011-01-01
          • 2013-04-03
          • 1970-01-01
          相关资源
          最近更新 更多