【问题标题】:Zend Framework error when uploaded on sub domainZend Framework 上传到子域时出错
【发布时间】:2012-08-03 05:00:11
【问题描述】:

domain.com 中创建子域后,我已将我的项目上传到zend.domain.com。所以最初我的代码是domain.com/zend。 当我尝试运行该项目时,它给了我这些错误:

警告:include_once(Zend/View.php) [function.include-once]:无法打开流:/home/domain/public_html/zend/library/Zend/Loader.php 中没有这样的文件或目录在线146

警告:include_once() [function.include]:无法打开“Zend/View.php”以包含(include_path='/home/domain/public_html/zend/application/../library:/home/domain/ public_html/zend/library:.:/usr/lib/php:/usr/local/lib/php') 在 /home/brainbud/public_html/zend/library/Zend/Loader.php 第 146 行

致命错误:在第 69 行的 /home/brainbud/public_html/zend/library/Zend/Application/Resource/View.php 中找不到类“Zend_View”

这是我的.htaccess

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^\.htaccess$ - [F]

RewriteRule ^(blog|forum)($|/) - [L]

RewriteCond %{REQUEST_URI} =""
RewriteRule ^.*$ /public/index.php [NC,L]

RewriteCond %{REQUEST_URI} !^/public/.*$
RewriteRule ^(.*)$ /public/$1

RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^.*$ - [NC,L]

RewriteRule ^public/.*$ /public/index.php [NC,L]

【问题讨论】:

    标签: php apache zend-framework


    【解决方案1】:

    这与您的 .htaccess 文件无关。您在上传时错过了一些库部分,或者库/Zend 在您的包含路径中不正确。

    • 重新上传 Zend
    • 检查 index.php 以获取正确的路径。 (ls /home/domain/public_html/zend/library 告诉你什么?)

    通常:

    // Define path to application directory
    defined('APPLICATION_PATH')
        || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));
    
    // Ensure library/ is on include_path
    set_include_path(implode(PATH_SEPARATOR, array(
        realpath(APPLICATION_PATH . '/../library'),
        get_include_path(),
    )));
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-05-02
      • 1970-01-01
      • 2014-11-14
      • 2013-05-21
      • 2011-07-08
      • 1970-01-01
      相关资源
      最近更新 更多