Magento:Mage_Core_Exception无效的块类型:Mage_Banners_Block_Banners

时间:2014-07-21 00:49:43

标签: magento nginx

任何人都知道Magento安装的内容是什么?

更改了虚拟主机上的某些设置(与此特定网站的虚拟主机无关),之后此网站停止加载?

我更改了设置但页面仍然无法正确加载。

这是一个浏览器拍摄的样子,你可以看到,几乎是空白...... enter image description here

这是Magento投掷的日志:

2014-07-20T14:11:41+00:00 ERR (3):
exception 'Mage_Core_Exception' with message 'Invalid block type: Mage_Banners_Block_Banners' in /home/nginx/dutchbarnheadshop/public/app/Mage.php:595
Stack trace:
#0 /home/nginx/dutchbarnheadshop/public/app/code/core/Mage/Core/Model/Layout.php(495): Mage::throwException('Invalid block t...')
#1 /home/nginx/dutchbarnheadshop/public/app/code/core/Mage/Core/Model/Layout.php(437): Mage_Core_Model_Layout->_getBlockInstance('banners/banners', Array)
#2 /home/nginx/dutchbarnheadshop/public/app/code/core/Mage/Core/Model/Email/Template/Filter.php(164): Mage_Core_Model_Layout->createBlock('banners/banners', NULL, Array)
#3 [internal function]: Mage_Core_Model_Email_Template_Filter->blockDirective(Array)
#4 /home/nginx/dutchbarnheadshop/public/lib/Varien/Filter/Template.php(134): call_user_func(Array, Array)
#5 /home/nginx/dutchbarnheadshop/public/app/code/core/Mage/Core/Model/Email/Template/Filter.php(504): Varien_Filter_Template->filter('{{block type="b...')
#6 /home/nginx/dutchbarnheadshop/public/app/code/core/Mage/Cms/Block/Block.php(54): Mage_Core_Model_Email_Template_Filter->filter('{{block type="b...')
#7 /home/nginx/dutchbarnheadshop/public/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Cms_Block_Block->_toHtml()
#8 /home/nginx/dutchbarnheadshop/public/app/design/frontend/default/fashionstore/template/page/3columns.phtml(62): Mage_Core_Block_Abstract->toHtml()
#9 /home/nginx/dutchbarnheadshop/public/app/code/core/Mage/Core/Block/Template.php(241): include('/home/nginx/dut...')
#10 /home/nginx/dutchbarnheadshop/public/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#11 /home/nginx/dutchbarnheadshop/public/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#12 /home/nginx/dutchbarnheadshop/public/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Template->_toHtml()
#13 /home/nginx/dutchbarnheadshop/public/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#14 /home/nginx/dutchbarnheadshop/public/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#15 /home/nginx/dutchbarnheadshop/public/app/code/core/Mage/Catalog/controllers/CategoryController.php(161): Mage_Core_Controller_Varien_Action->renderLayout()
#16 /home/nginx/dutchbarnheadshop/public/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Catalog_CategoryController->viewAction()
#17 /home/nginx/dutchbarnheadshop/public/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('view')
#18 /home/nginx/dutchbarnheadshop/public/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#19 /home/nginx/dutchbarnheadshop/public/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#20 /home/nginx/dutchbarnheadshop/public/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#21 /home/nginx/dutchbarnheadshop/public/index.php(87): Mage::run('default', 'store')
#22 {main}

这是nginx配置:

server {
    server_name
        **HIDDEN**
        **HIDDEN**
    ;

    listen 80;

    return 301 https://**HIDDEN**$request_uri;
}

server {
    server_name
        **HIDDEN**
        **HIDDEN**
    ;

    listen 443 ssl;

    ssl_certificate ssl/dutchbarnheadshop.pem;
    ssl_certificate_key ssl/dutchbarnheadshop.key;

    root /home/nginx/dutchbarnheadshop/public;
    #index index.html index.php;

    access_log /home/nginx/dutchbarnheadshop/logs/access.log;
    error_log /home/nginx/dutchbarnheadshop/logs/error.log;

    location / {
        index index.html index.php;
        try_files $uri $uri/ @handler;
        expires 30d;
    }

    location ^~ /app/                       { deny all; }
    location ^~ /includes/                  { deny all; }
    location ^~ /lib/                       { deny all; }
    location ^~ /media/downloadable/        { deny all; }
    location ^~ /pkginfo/                   { deny all; }
    location ^~ /report/config.xml          { deny all; }
    location ^~ /var/                       { deny all; }

    location /var/export {
        auth_basic              "Restricted";
        auth_basic_user_file    htpasswd;
        autoindex               on;
    }

    location /. {
        return 404;
    }

    location @handler {
        rewrite / /index.php;
    }

    location ~ .php/ {
        rewrite ^(.*.php)/ $1 last;
    }

    location ~ .php$ {
        if (!-e $request_filename) { rewrite / /index.php last; }
        expires off;
        fastcgi_pass    unix:/var/run/php5-fpm.sock;
        fastcgi_param   HTTPS           $fastcgi_https;
        fastcgi_param   SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param   MAGE_RUN_CODE   default;
        fastcgi_param   MAGE_RUN_TYPE   store;
        fastcgi_param   MAGE_IS_DEVELOPER_MODE true;
        include         fastcgi_params;
        fastcgi_buffer_size 128k;
        fastcgi_buffers 256 16k;
        fastcgi_busy_buffers_size 256k;
        fastcgi_temp_file_write_size 256k;
        fastcgi_read_timeout 240;
    }
}

我不知道它为什么不加载!这让我把头发撕掉了!

1 个答案:

答案 0 :(得分:0)

我设法找出问题,在Magento开始在页面上抛出错误后说:

Parse error: syntax error, unexpected 'this' (T_STRING), expecting variable (T_VARIABLE) or '$' in 
/home/nginx/dutchbarnheadshop/public/app/design/frontend/default/fashionstore/template/page/html/header.phtml on line 52

所以我打开了header.phtml,如错误所示,发现了这个:

<?php echo $ this -> getChildHtml('qbanner.top') ?>

正如你所看到的,$和this之间的空间是不需要的,所以我删除了它,重新启动了php5-fpm并再次工作了!

我认为这是因为这个特定文件是由php5-xcache缓存的,当我昨天重新启动服务器时,缓存显然已被删除。当它尝试重新加载此文件时,该文件出现语法错误。

感谢大家的建议!