2014-04-10 42 views
0

我試圖安裝SiteCake我的基本的網站,其結構如下: HTML:時出錯 - 未定義偏移:0:當我試圖安裝SiteCake

<!DOCTYPE html> 
<html lang="en"> 
<head> 
    <meta charset="utf-8"> 
    <meta content="width=device-width, initial-scale=1.0, user-scalable=0" name="viewport"> 

    <title>Index | Website Name</title> 
    <meta content="" name="description"> 
    <link href="assets/elements/favicon.ico" rel="shortcut icon"> 
    <link href="assets/css/reset.css" rel="stylesheet" type="text/css"> 
    <link href="assets/css/core.css" rel="stylesheet" type="text/css"> 
    <link href="assets/css/tablet-and-mobile.css" media="screen and (max-width: 1024px)" rel="stylesheet"> 
    <link href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" rel="stylesheet"><!--Libraries & Scripts--> 

    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script> 
    <script src="assets/js/main.js" type="text/javascript"></script><!--IE Support--> 
    <!--[if IE]><script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]--> 
</head> 

<body id="index"> 

    <header id="header"><!--Header--> 
     <div id="headerContent"> 
     <div id="headerLogo"> 
      <!--Logo--><a href=""><img alt="Website Name Logo" src="assets/elements/logo.png"></a> 
     </div> 
     <nav><!--Main Menu--> 
      <ul id="mainMenu"> 
       <li><a class="active" href="index.php">Home</a></li> 
       <li><a href="contact.php">Contact</a></li> 
      </ul> 
     </nav> 
     </div> 
    </header> 

    <div id="page"><!--Page Container--> 

     <div class="topSection"> 
     <div class="content"> 
      <h1>Page Title</h1> 
     </div> 
     </div> 

     <!--Footer--> 
     <footer id="footer"> 
     <div class="content"> 
      <div class="copyright"> 
       <p>©2014 Website Name. All rights reserved.</p> 
      </div> 
     </div> 
     </footer> 
    </div><!--/Page--> 
    <!--Scripts--> 
    <script src="assets/js/form-validation.js" type="text/javascript"></script> 
    <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script> 
</body> 
</html> 

我按照提供的指令在SiteCake,加入<?php include "sitecake/server/sitecake_entry.php"; ?>頁面...的最頂端,一旦我這樣做,它顯示了這個錯誤:

An error occurred 

Application error 

Exception information: 

Message: Undefined offset: 0 

Stack trace: 

#0 /home/clients/public_html/sitecake/server/application/services/impl/basic/PageTemplateImpl.php(142): Bootstrap::globalErrorHandler(8, 'Undefined offse...', '/home/clients/p...', 142, Array) 
#1 /home/clients/public_html/sitecake/server/application/services/impl/basic/PageTemplateImpl.php(117): PageTemplateImpl->createTemplate() 
#2 /home/clients/public_html/sitecake/server/application/services/impl/basic/PageTemplateImpl.php(34): PageTemplateImpl->initTemplateEngine() 
#3 /home/clients/public_html/sitecake/server/application/services/impl/basic/RenderServiceImpl.php(54): PageTemplateImpl->setPageRequest('/index.php') 
#4 /home/clients/public_html/sitecake/server/application/services/impl/basic/RenderServiceImpl.php(23): RenderServiceImpl->renderResponse() 
#5 /home/clients/public_html/sitecake/server/application/controllers/RenderController.php(13): RenderServiceImpl->render('/index.php', false) 
#6 /home/clients/public_html/sitecake/server/library/Zend/Controller/Action.php(513): RenderController->renderAction() 
#7 /home/clients/public_html/sitecake/server/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('renderAction') 
#8 /home/clients/public_html/sitecake/server/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http)) 
#9 /home/clients/public_html/sitecake/server/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch() 
#10 /home/clients/public_html/sitecake/server/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run() 
#11 /home/clients/public_html/sitecake/server/sitecake_entry.php(47): Zend_Application->run() 
#12 /home/clients/public_html/index.php(1): include('/home/clients/p...') 
#13 {main} 
Request Parameters: 

array (
    'controller' => 'render', 
    'action' => 'render', 
) 

哪些可以住在這裏看到:http://loai.directory

以下是showen在error.log中:

[10-Apr-2014 11:29:02 UTC] PHP Fatal error: Uncaught exception 'Zend_Exception' with message 'Cannot modify header information - headers already sent by (output started at /home/clients/public_html/index.php:2)' in /home/clients/public_html/sitecake/server/application/services/impl/onesite/Bootstrap.php:122 
Stack trace: 
#0 [internal function]: Bootstrap::globalErrorHandler(2, 'Cannot modify h...', '/home/clients/p...', 3, Array) 
#1 /home/clients/public_html/sitecake/server/application/layouts/scripts/layout.phtml(3): header('Expires: Mon, 2...') 
#2 /home/clients/public_html/sitecake/server/library/Zend/View.php(108): include('/home/clients/p...') 
#3 /home/clients/public_html/sitecake/server/library/Zend/View/Abstract.php(880): Zend_View->_run('/home/clients/p...') 
#4 /home/clients/public_html/sitecake/server/library/Zend/Layout.php(796): Zend_View_Abstract->render('layout.phtml') 
#5 /home/clients/public_html/sitecake/server/library/Zend/Layout/Controller/Plugin/Layout.php(143): Zend_Layout->render() 
#6 /home/clients/public_html/sitecake/server/library/ in /home/clients/public_html/sitecake/server/application/services/impl/onesite/Bootstrap.php on line 122 
[10-Apr-2014 11:29:23 UTC] PHP Fatal error: Uncaught exception 'Zend_Exception' with message 'Cannot modify header information - headers already sent by (output started at /home/clients/public_html/index.php:2)' in /home/clients/public_html/sitecake/server/application/services/impl/onesite/Bootstrap.php:122 
Stack trace: 
#0 [internal function]: Bootstrap::globalErrorHandler(2, 'Cannot modify h...', '/home/clients/p...', 3, Array) 
#1 /home/clients/public_html/sitecake/server/application/layouts/scripts/layout.phtml(3): header('Expires: Mon, 2...') 
#2 /home/clients/public_html/sitecake/server/library/Zend/View.php(108): include('/home/clients/p...') 
#3 /home/clients/public_html/sitecake/server/library/Zend/View/Abstract.php(880): Zend_View->_run('/home/clients/p...') 
#4 /home/clients/public_html/sitecake/server/library/Zend/Layout.php(796): Zend_View_Abstract->render('layout.phtml') 
#5 /home/clients/public_html/sitecake/server/library/Zend/Layout/Controller/Plugin/Layout.php(143): Zend_Layout->render() 
#6 /home/clients/public_html/sitecake/server/library/ in /home/clients/public_html/sitecake/server/application/services/impl/onesite/Bootstrap.php on line 122 
[10-Apr-2014 07:43:04 America/New_York] PHP Fatal error: Call to undefined function href() in /home/clients/public_html/assets/includes/menu.inc on line 1 
[10-Apr-2014 07:43:05 America/New_York] PHP Fatal error: Call to undefined function href() in /home/clients/public_html/assets/includes/menu.inc on line 1 

試圖解決這個問題,我試圖改變的包括與身體內的某處添加它,我也試着位置變化包括對include_once,並且還試圖把下面的代碼片段添加到頁腳:

<?php 
      include 「extern_php_code.php」; 
      echo render_footer(); 
     ?> 

但沒有什麼工作對我來說,我在做什麼錯?

+0

你的問題的內容是不特定的。閱讀所有內容非常困難。所以它會更好,如果你減少它只是爲了我們瞭解你的問題.. –

+0

感謝您的評論,請現在看看 – Leo

+0

發佈代碼'public_html/sitecake/server/application/services/impl/basic/PageTemplateImpl.php'如果它太大,帖子從120到150 –

回答

0

請檢查下面的線#142文件,它是你的未定義錯誤的源極偏移0可能當數組是空的,而不是在索引0

/home/clients/public_html/sitecake/server/application/services/impl/basic/PageTemplateImpl.php(142) 

see herestack overflow quetsion

有元素
+0

我已經試過這些... – Leo

+0

檢查這個配置設置:http ://sitecake.com/using-php-in-templates.php – Suketu

0

看起來你的頭標不見了。 ALTER線142這樣或者檢查是否缺少頭標記

if(isset($head[0])){ 
    $head[0]->innertext .= '$$$#sc_header[{{}}]'; 
} 
else { 
    // head tag not found 
} 
+0

我替換它,不工作 - 是從該文件出來的問題?如果(isset($ head))'爲'if(isset($ head [0]))',則稍微修改上面的代碼 – Leo

+0

。嘗試這個。如果它仍然不起作用,請通過代碼ñ告訴我它試圖加載什麼文件。因爲它試圖加載的任何文件都不包含頭標籤或該文件未加載。同樣,如果當前錯誤消失,並且您收到任何其他錯誤,則更新 –

+0

同樣的問題,但我沒有真正玩過這些文件,我基本上從Sitecake上下載了它們並上傳了它們,沒有碰到它們 – Leo