一直在用QeePHP的APM Express作为PHP开发环境,今天才发现,廖大已经给附带了安装好的PEAR,不得不膜拜廖大的无微不至。
不过直接使用PEAR.bat会提示 找不到 'PEAR.php'的错误
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
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
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 {
ini_set ( ' include_path ' , ' K:\apmxe\php5\pear ' );
$raw = false ;
} else {
将其中的路径修改为当前APMEX的安装路径即可。
命令行运行:pear list
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
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
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