0
    Error: [2] require_once(Zend/Loader/Autoloader.php) [function.require-once]: failed to open stream: No such file or directory

/var/www/vhosts/localhost/httpdocs/public.:./var/www/vhosts/localhost/httpdocs/public/../library:./var/www/vhosts/localhost/httpdocs/public/../model:.


defined('SITE_ROOT') ? null : define('SITE_ROOT',$_SERVER['DOCUMENT_ROOT']);

$includePath[] = '.';
$includePath[] = '.' . SITE_ROOT . '/../library';
$includePath[] = '.' . SITE_ROOT . '/../model';
$includePath[] = get_include_path();
$includePath = implode(PATH_SEPARATOR,$includePath);
set_include_path($includePath);




require_once 'Zend/Loader/Autoloader.php';

请帮我正确设置 set_include_path。

4

1 回答 1

2

您正在使用这样的行:

$includePath[] = '.' . SITE_ROOT . '/../library';

这会为您提供一个 include_path ,例如:

./var/www/vhosts/localhost/httpdocs/public/../library

注意.那条路径的开头——我猜它不应该在那里。

尝试.在每条路径的开头删除那些:

$includePath[] = '.';
$includePath[] = SITE_ROOT . '/../library';
$includePath[] = SITE_ROOT . '/../model';
$includePath[] = get_include_path();
$includePath = implode(PATH_SEPARATOR,$includePath);
set_include_path($includePath);


有关信息:.UNIX 路径中的 A 表示“当前目录”;/路径开头的 a 表示“服务器的根目录”。

因此,诸如路径之类的路径./var/www实际上表示“当前www目录中的var目录中的目录”

您可能需要类似“位于服务器根目录中的目录”之类的内容wwwvar

于 2010-02-27T11:34:33.930 回答