【发布时间】:2011-05-27 20:48:45
【问题描述】:
每个人。我的梨有点麻烦。
我在我的localhost中测试(我的localhost路径是e:\www),我的系统是windows xp sp3,我的php版本是5.2.11,路径是C:\Program Files\phpStudy\PHP5,我在这个路径中运行go-pear.bat并完成安装pear , 现在梨路径在C:\Program Files\phpStudy\PHP5\PEAR(文件夹下包含.channels,.registry,OS,PEAR,.depdb,.depdblock,.filemap,; Windows: "\path1;\path2"
include_path = ".;C:\Program Files\phpStudy\PHP5\PEAR"
,@9876 ),然后我运行C:\Program Files\phpStudy\PHP5\PEAR_ENV.reg并修改php.ini,
; Windows: "\path1;\path2"
include_path = ".;C:\Program Files\phpStudy\PHP5\PEAR"
重启 apache 后,我测试了一个从 pear 网站复制的简单代码。
<?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