山狮php梨和pecl

ian*_*ckc 10 php pear pecl osx-mountain-lion

我升级到Mountain Lion并安装了php5.4,这需要一些调整Mountain Lion更改php位置

我的下一个问题是如果我跑pear -v或者pecl -v这些回归

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

Could not open input file: /usr/lib/php/pear/peclcmd.php
Run Code Online (Sandbox Code Playgroud)

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

如果是这样,我该如何做,我将丢失所有以前安装的扩展程序,如phpunit?

谢谢

ian*_*ckc 16

我通过再次安装梨来分类.下载go-pear.phar然后运行

sudo php -d detect_unicode=0 go-pear.phar
Run Code Online (Sandbox Code Playgroud)

在安装中,有一些选项可以更改pear正在使用的目录.他们已经设置到我的新PHP的正确位置,如/ usr/local/php5/bin

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

export PATH=$PATH:/usr/local/php5/bin
Run Code Online (Sandbox Code Playgroud)

为了让pecl再次工作,我从/ usr/bin中删除了pecl,然后符号链接到/ usr/local/php5/bin中的pecl

sudo ln -s /usr/local/php5/bin/pecl /usr/bin/pecl
Run Code Online (Sandbox Code Playgroud)

我试图安装的第一个包是APC,我收到了错误

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

ERROR: `phpize' failed
Run Code Online (Sandbox Code Playgroud)

这是根据phpize的以下说明排序将无法在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
Run Code Online (Sandbox Code Playgroud)

which phpunit回来了/usr/bin/phpunit

通过更多的符号解决

sudo ln -s /usr/local/php5/bin/phpunit phpunit
Run Code Online (Sandbox Code Playgroud)


Cfr*_*eak 10

在小牛队中有一个/usr/lib/php叫做的文件install-pear-nozlib.phar

只需sudo php install-pear-nozlib.phar从该目录运行即可 .然后添加/usr/lib/php/pear到php.ini中的include路径

希望能帮助别人