<?php
require_once 'Zend/Application/Exception.php';
class AuthAdapter implements Zend_Auth_Adapter_Interface
{
protected  $name;
protected  $pwd;
public  function __construct($name,$pwd)
{
$this->name=$name;
$this->pwd=$pwd;
}
public  function authenticate()
{
$array;
if (($this->name=='long')&&($this->pwd=='admin'))
{
$array[0]=true;
return new Zend_Auth_Result(1, $array);
}else{
$array[0]=FALSE;
return New Zend_Auth_Result(-1, $array);

}
}
}
?>我的错误代码Warning: require_once(Zend/Application/Exception.php) [function.require-once]: failed to open stream: No such file or directory in F:\wamp\www\zf2\public\landing.php on line 2Fatal error: require_once() [function.require]: Failed opening required 'Zend/Application/Exception.php' (include_path='.;C:\php5\pear') in F:\wamp\www\zf2\public\landing.php on line 2

解决方案 »

  1.   

    zend包路径错了,加一句set_include_path('zend路径');试下
      

  2.   

    require_once '../library/Zend/Session/Namespace.php';
    $name= new Zend_Session_Namespace();
    $name->sess = "Session 已经存在";
    require_once '../library/Zend/Auth/Adapter/Interface.php';
      

  3.   

    在index.php或者这个文件最开头加入:
    set_include_path(implode(PATH_SEPARATOR, array(
        realpath('../library'),
        get_include_path(),
    )));