2016-09-06 148 views
1

使用pecl install -n solr No releases available for package "pecl.php.net/solr" install failed 无法安装PHP Solr的扩展

也试过pear install pecl/solr可以得到相同的输出: No releases available for package "pecl.php.net/solr" install failed

我使用的是Mac和php56。输出的pecl -V PEAR Version: 1.9.4 PHP Version: 5.6.25 Zend Engine Version: 2.6.0 Darwin Kernel Version 15.4.0: Fri Feb 26 22:08:05 PST 2016; root:xnu-3248.40.184~3/RELEASE_X86_64 x86_64

的另一个重要信息是,pearpecl都不在我的系统中可用,所以我用

sudo php /usr/lib/php/install-pear-nozlib.phar -d /usr/local/lib/php -b /usr/local/bin

安装这些更新

试过sudo pecl install -n solr,现在它似乎走一步

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

回答

0

幸运的偶然发现

PEAR package install fails

而导致执行 pear list-upgrades这表明某种权限问题与缓存目录,手动创建在指定位置使用sudo的目录(/private/tmp/pear/cache

然后使用sudo来安装Solr的扩展为sudo pecl install -n solr它扔了以下错误:

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

brew install autoconf其次sudo pecl install solr工作。