大多数在线教程都展示了如何通过执行以下操作来安装 PEAR:
sudo apt-get install php-pear
Run Code Online (Sandbox Code Playgroud)
这将安装 1.6.1 版。它很好用,因为它超级简单!我的问题是我想安装 PHPUnit,它需要 PEAR 版本 1.8.1,所以我的 PHPUnit 安装失败。那么如何在 Ubuntu 上安装更新版本的 PEAR?
看起来可能是1.7.2
,但我没有在 pear 网站上找到任何明确的“这是 PEAR 的当前版本”。
我正在尝试在我不太熟悉的系统上升级 PEAR。
梨型产量...
PEAR Version: 1.4.9
PHP Version: 5.1.6
Zend Engine Version: 2.1.0
Running on: Linux...
Run Code Online (Sandbox Code Playgroud)
我跑了pear upgrade pear
,这条消息被包括在内。
pear/PEAR dependency package "pear/Archive_Tar" installed version 1.3.5 is not the recommended version 1.3.3, but may be compatible, use --force to install
pear/Archive_Tar requires PEAR Installer (version >= 1.5.4), installed version is 1.4.9
Run Code Online (Sandbox Code Playgroud) $ sudo pear install phpunit/PHPUnit
Unknown remote channel: pear.symfony-project.com
phpunit/PHPUnit requires package "channel://pear.symfony-project.com/YAML" (version >= 1.0.2)
phpunit/PHPUnit can optionally use PHP extension "xdebug" (version >= 2.0.5)
No valid packages found
install failed
Run Code Online (Sandbox Code Playgroud)
我需要做什么才能安装 PHPUnit?
我被这个问题难住了。我有 2 台单独的 Mac,它们根本无法通过名称或 IP 访问 pear.php.net。
以下是我尝试解决/缩小此问题的症状和步骤。
$ ping -c 4 pear.php.net
PING euk1.php.net (5.77.39.20): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
--- euk1.php.net ping statistics ---
4 packets transmitted, 0 packets received, 100.0% packet loss
$ ping -c 4 5.77.39.20
PING 5.77.39.20 (5.77.39.20): 56 data bytes
ping: sendto: No route to host
Request timeout for icmp_seq 0
ping: sendto: Host is down
Request timeout for icmp_seq 1 …
Run Code Online (Sandbox Code Playgroud) 跑步时
出现以下错误:
PHP Fatal error: Call to undefined method PEAR::raiseErro() in /usr/share/php/PEAR/REST.php on line 165
PHP Stack trace:
PHP 1. {main}() /usr/share/php/pearcmd.php:0
PHP 2. PEAR_Command_Common->run() /usr/share/php/pearcmd.php:305
PHP 3. PEAR_Command_Install->doInstall() /usr/share/php/PEAR/Command/Common.php:271
PHP 4. PEAR_Command_Install->doUpgradeAll() /usr/share/php/PEAR/Command/Install.php:547
PHP 5. PEAR_Command_Install->doInstall() /usr/share/php/PEAR/Command/Install.php:902
PHP 6. PEAR_Command_Install->_filterUptodatePackages() /usr/share/php/PEAR/Command/Install.php:619
PHP 7. PEAR_REST_10->listLatestUpgrades() /usr/share/php/PEAR/Command/Install.php:1233
PHP 8. PEAR_REST->retrieveData() /usr/share/php/PEAR/REST/10.php:649
Run Code Online (Sandbox Code Playgroud)
有什么建议是什么原因造成的?
谢谢。
pear ×5
php ×3
ubuntu ×2
upgrade ×2
installation ×1
ip ×1
linux ×1
osx-lion ×1
phpunit ×1
ubuntu-11.04 ×1