Code Snippet

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理


一直在用QeePHP的APM Express作为PHP开发环境,今天才发现,廖大已经给附带了安装好的PEAR,不得不膜拜廖大的无微不至。

不过直接使用PEAR.bat会提示 找不到 'PEAR.php'的错误

运行PEAR的错误提示
K:\apmxe\php5>pear

Warning: require_once
(PEAR.php): failed to open stream: No such file or director
y in Config
.php on line 27

Warning: require_once
(PEAR.php): failed to open stream: No such file or director
y in K:
\apmxe\php5\PEAR\PEAR\Config.php on line 27

Fatal error: require_once
(): Failed opening required 'PEAR.php' (include_path='D
:
\apmxe\php5\pear') in K:\apmxe\php5\PEAR\PEAR\Config.php on line 27

看到是因为路径不同引起的,需要修改命令配置文件 K:\apmxe\php5\PEAR\pearcmd.php

在第32行,判断是否为PHP环境设置了PEAR的路径

if ('K:\apmxe\php5\pear' != '@'.'include_path'.'@') {
ini_set('include_path', 'K:\apmxe\php5\pear');
$raw = false;
}
else {

将其中的路径修改为当前APMEX的安装路径即可。

 

命令行运行:pear list

代码
K:\apmxe\php5>pear list
INSTALLED PACKAGES
, CHANNEL PEAR.PHP.NET:
=========================================
PACKAGE VERSION STATE
Archive_Tar
1.3.2 stable
Console_Getopt
1.2.3 stable
PEAR
1.7.2 stable
Structures_Graph
1.0.2 stable

 

愉快的看到,已经安装好的PEAR程序列表

 

最后,更新,即可开始PEAR之旅

 

pear channel-update pear.php.net

 

 

 

posted on 2010-11-21 21:52  kmlxk  阅读(515)  评论(0编辑  收藏  举报