Windows - PHPDocs无法通过Pear安装

时间:2015-05-20 19:26:39

标签: php wamp pear

运行两个命令来安装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

6 个答案:

答案 0 :(得分:10)

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

答案 1 :(得分:6)

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

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

pear install --nocompress phpdoc/phpDocumentor

答案 2 :(得分:2)

我试过@kguest回答 - >

predict.lm
没有运气。所以我尝试了#34;升级"

  pear install --nocompress phpdoc/phpDocumentor

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

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

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

2)将最近提取的文件重新打包为TAR(我使用了7zip)。

3)重新尝试升级,但是从新创建的TAR中重新尝试:

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

只有这样才有效。

答案 3 :(得分:2)

phpDocumentor 2.8.5 的解决方案是

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

  2. 解压缩存档 phpDocumentor-2.8.5.tgz manulay(例如使用7zip)您将获得 phpDocumentor-2.8.5.tar ,解压缩你也会得到文件夹 phpDocumentor-2.8.5 和文件 package.xml

  3. 修改存档 package.xml 并将文字模板: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

答案 4 :(得分:2)

经过几个小时的尝试,其他人的解决方案我终于得到了它的工作phpDocumentor 2.9.0

您可以从以下网址下载:

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

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

答案 5 :(得分:-1)

此问题尤其适用于Windows操作系统,以避免错误:

  

错误:无法打开包装......

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

相关问题