1

我正在使用 ubuntu 12.04

我使用这个命令安装了 php pear

sudo apt-get install php-pear php5-dev

我得到了这个结果

Reading package lists... Done
Building dependency tree       
Reading state information... Done
php-pear is already the newest version.
php5-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

现在当我使用这个命令时

sudo pecl install v8js-0.1.3

我收到此错误

sudo: pecl: command not found

有人能告诉我如何解决这个错误吗?谢谢

4

3 回答 3

1

找到您的pecl. 即whichlocate

检查sudo 上的secure_path

[root@host ~]# sudo -V | grep 'Value to override'
Value to override user's $PATH with: /sbin:/bin:/usr/sbin:/usr/bin

如果$PATH被我们覆盖visudo并编辑/etc/sudoers并将路径附加到 pecl

Defaults    secure_path = /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin
于 2013-09-01T16:55:48.830 回答
0

我们需要梨!出于某种原因,它还没有准备好在 Lion 上设置,但是安装 phar 文件在这里,所以我们只需要运行它。

cd /usr/lib/php sudo php install-pear-nozlib.phar

编辑:/etc/php.ini 并找到该行:; include_path = ".:/php/includes" 并将其更改为: include_path = ".:/usr/lib/php/pear" sudo pear channel-update pear.php.net sudo pecl channel-update pecl.php.net sudo梨升级全部

于 2013-10-22T09:37:48.817 回答
0

The simple way that worked for me is by browsing to the folder where your pecl located thru your nautilus explorer and double click pecl icon. then after that you might type sudo pecl install whatever

于 2013-12-15T02:41:01.293 回答