2012-08-11 84 views
9

我已经升级到山狮和安装php5.4历时调整的位Mountain Lion change php location山狮PHP梨和PECL

我的下一个问题是,如果我跑pear -vpecl -v这些返回

Could not open input file: /usr/lib/php/pear/pearcmd.php 

Could not open input file: /usr/lib/php/pear/peclcmd.php 

我是否需要更改pear和pecl以指向安装在/ usr/local/php5/bin/

中的新php如果是这样,我该怎么做,并且会丢失所有以前安装的扩展作为phpunit?

感谢

回答

15

我通过再次安装pear来排序。下载go-pear.phar后运行

sudo php -d detect_unicode=0 go-pear.phar 

在安装中有更改pear正在使用的目录的选项。他们已经被设置为我的新php的正确位置,例如/ usr/local/php5/bin

然后,我必须将该路径添加到我的bash_profile中,以便识别pear命令。

export PATH=$PATH:/usr/local/php5/bin 

要获得PECL再次合作我删除PECL从/ usr/bin中,然后符号链接到在/ usr /本地/ PHP5/bin中

sudo ln -s /usr/local/php5/bin/pecl /usr/bin/pecl 

我试图安装第一包是APC的PECL和我

Cannot find autoconf. Please check your autoconf installation and the 
$PHP_AUTOCONF environment variable. Then, rerun this script. 

ERROR: `phpize' failed 

这是通过下面的说明排序从phpize won't work on Mac OS X Lion我用自制的解决方案错误

更新:我安装然后PHPUnit的细跑phpunit --version

这给了

PHP Warning: require(/usr/lib/php/pear/PHPUnit/Autoload.php): failed to open stream: No such file or directory in /usr/bin/phpunit on line 43 

运行which phpunit返回/usr/bin/phpunit

由多个符号链接

sudo ln -s /usr/local/php5/bin/phpunit phpunit 
2

我与我在我的Mac用户的一个这个问题。它与另一个正常工作。所以我想这可能与使用其他用户安装pear有关(如我所做的那样)。

我没有解决这个问题,但你可以尝试再次安装梨并尝试选择安装到系统而不是本地,看看是否有效。

编辑:我试图做到这一点,但梨开始工作,但不pecl。

10

解决了在小牛队有一个错误档案/usr/lib/php调用install-pear-nozlib.phar

一切正常运行从该目录运行 sudo php install-pear-nozlib.phar。然后将/usr/lib/php/pear添加到php的include路径中。ini

希望可以帮助别人

+1

谢谢,在优胜美地工作 – 2014-07-15 14:11:28