【问题标题】:Trying to install PEAR on Mac OSX 10.6.8尝试在 Mac OSX 10.6.8 上安装 PEAR
【发布时间】:2012-10-24 09:02:31
【问题描述】:

谁能告诉我如何在我的 MAC 上安装 PEAR?

尝试 1:

curl http://pear.php.net/go-pear | sudo php
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 88959  100 88959    0     0  70283      0  0:00:01  0:00:01 --:--:--  200k
Sorry!  Your PHP version is too new (5.3.8) for this go-pear.
Instead use http://pear.php.net/go-pear.phar for a more stable and current
version of go-pear, more suited to your PHP version.

Thank you for your coopertion and sorry for the inconvenience!

尝试 2:

curl http://pear.php.net/go-pear.phar | sudo php
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 3594k  100 3594k    0     0  1150k      0  0:00:03  0:00:03 --:--:-- 1351k

Warning: Phar::mapPhar(-): failed to open stream: No such file or directory in - on line 1119
unable to open phar for reading "-"
Warning: require_once(phar://go-pear.phar/index.php): failed to open stream: phar error: invalid url or non-existent phar "phar://go-pear.phar/index.php" in - on line 1236

尝试 3(来自http://sudhanshuraheja.com/2011/03/installing-php-pear-on-mac-osx-10-6-with-php-5-3-3/):

curl http://pear.php.net/go-pear.phar > go-pear.phar
-bash: go-pear.phar: Permission denied

我正在尝试安装 phpUnit,但没有 pear 就无法安装。

【问题讨论】:

标签: macos terminal pear


【解决方案1】:

最后一个是正确的:您不能将curl|php 方法用于较新的版本(这就是文档不再建议它的原因)。

来自 bash 的错误消息应该可以准确地告诉您出了什么问题。您正在尝试保存一个名为 go-pear.phar 的文件,但您没有这样做的权限。这很可能是因为您将 cd'd 放入了您没有写入权限的目录,例如 /

一种解决方案是这样做:

http://pear.php.net/go-pear.phar > ~/go-pear.phar
sudo php ~/go-pear.phar

更简单的是,如果你打开一个新的终端,你最终会进入 ~,你可以完全按照说明进行操作,它们会起作用。

【讨论】:

    【解决方案2】:

    在终端 $ wget http://pear.php.net/go-pear.phar

    在终端下载后。这适用于使用 PHP 5.4 的人

    $ php -q go-pear.phar
    

    【讨论】:

      猜你喜欢
      • 2012-01-11
      • 2013-05-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-05-14
      • 1970-01-01
      • 1970-01-01
      • 2012-01-16
      相关资源
      最近更新 更多