everyone. I have some trouble in pear.
I test in my localhost(my localhost path is e:\www
), my system is windows xp sp3, My php version is 5.2.11, the path is C:\Program Files\phpStudy\PHP5
, I run go-pear.bat
in this path and finished install the pear, now the pear path is in C:\Program Files\phpStudy\PHP5\PEAR
(under the folder contains .channels
,.registry
, OS
, PEAR
, .depdb
, .depdblock
, .filemap
, .lock
, go-pear.phar
), then I run C:\Program Files\phpStudy\PHP5\PEAR_ENV.reg
and modify the php.ini,
; Windows: "\path1;\path2"
include_path = ".;C:\Program Files\phpStudy\PHP5\PEAR"
After restart the apache, I test a simple code which copy from pear's website.
<?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();
}
?>
but it return
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
What's wrong is it? How to solve? Thanks.