everyone。我在梨上遇到了一些麻烦。我的localhost路径是e:\www
),我的系统是windows xp sp3,我的php版本是5.2.11,路径是C:\Program Files\phpStudy\PHP5
,我在这个路径下运行go-pear.bat
并完成安装梨,现在梨路径在C:\Program Files\phpStudy\PHP5\PEAR
(下文件夹包含.channels
,.registry
,OS
,PEAR
,.depdb
,.depdblock
,.filemap
,.lock
,go-pear.phar
),然后我跑C:\Program Files\phpStudy\PHP5\PEAR_ENV.reg
和修改php.ini,无法打开所需的'HTTP/Request2.php'(include_path ='.; C: php5 pear')
; Windows: "\path1;\path2"
include_path = ".;C:\Program Files\phpStudy\PHP5\PEAR"
重新启动Apache后,我测试一个简单的代码,从梨的网站复制。
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2('http://pear.php.net/', HTTP_Request2::METHOD_GET);
try {
$response = $request->send();
if (200 == $response->getStatus()) {
echo $response->getBody();
} else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
} catch (HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
?>
但它返回
Warning: require_once(HTTP/Request2.php) [function.require-once]: failed to open stream: No such file or directory in E:\www\ct\1.php on line 2
Fatal error: require_once() [function.require]: Failed opening required 'HTTP/Request2.php' (include_path='.;C:\php5\pear') in E:\www\ct\1.php on line 2
有什么不对呢?怎么解决?谢谢。
你缺少文件e:\ www \ HTTP \ Request2.php – 2010-12-19 18:13:56