<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                <table cellspacing="0" cellpadding="0" width="100%" summary="Header navigation table" border="0"><tbody><tr><th align="middle" colspan="3">Smarty - the compiling PHP template engine</th></tr><tr><td valign="bottom" align="left" width="25%"><a accesskey="P" href="appendixes.html">Prev</a></td> <td valign="bottom" align="middle" width="50%"/> <td valign="bottom" align="right" width="25%"><a accesskey="N" href="tips.html">Next</a></td></tr></tbody></table> # Chapter 17. Troubleshooting 第十七章. 疑難解答 **Table of Contents**[Smarty/PHP errors](#)[錯誤] # Smarty/PHP errors[錯誤] Smarty can catch many errors such as missing tag attributes or malformed variable names. If this happens,you will see an error similar to the following: Smarty能夠捕獲許多錯誤,比如缺少標簽屬性或者不規范變量名。如果發生這種錯誤,就會有類似下面的錯誤提示: <table class="EXAMPLE" cellspacing="0" cellpadding="0" width="100%" border="0"><tbody><tr><td> <div class="EXAMPLE"><a name="AEN4189"/> <b>Example 17.1. Smarty errors<br/> 例17-1.Smarty 錯誤</b> <table width="100%" bgcolor="#e0e0e0" border="0"><tbody><tr><td><pre class="PROGRAMLISTING">Warning: Smarty: [in index.tpl line 4]: syntax error: unknown tag - '%blah'&#13; in /path/to/smarty/Smarty.class.php on line 1041警告:Smarty: 在index.tpl文件第4行,語法錯誤:'%blah'標簽未知&#13; &#13; Fatal error: Smarty: [in index.tpl line 28]: syntax error: missing section name&#13; in /path/to/smarty/Smarty.class.php on line 1041嚴重錯誤:Smarty: 在index.tpl文件第28行,語法錯誤:缺少節段名字在 /path/to/smarty/路徑中的Smarty.class.php文件1041行</pre></td></tr></tbody></table></div></td></tr></tbody></table> Smarty shows you the template name, the line number and the error. After that, the error consists of the actual line number in the Smarty class that the error occured. There are certain errors that Smarty cannot catch, such as missing close tags. These types of errors usually end up in PHP compile-time parsing errors. Smarty可以顯示模板名稱以及行號和錯誤。后面跟著包含這些錯誤在smarty類所在的實際行號。 Smarty不能捕獲某些錯誤,像缺少結束標簽。這類型的錯誤一般以php編譯時解析錯誤終止。 <table class="EXAMPLE" cellspacing="0" cellpadding="0" width="100%" border="0"><tbody><tr><td> <div class="EXAMPLE"><span class="PROGRAMLISTING"><strong>Example 17.2. PHP parsing errors</strong></span><br/><strong>例17-2.php解析錯誤</strong><table width="100%" bgcolor="#e0e0e0" border="0"><tbody><tr><td><pre class="PROGRAMLISTING">Parse error: parse error in /path/to/smarty/templates_c/index.tpl.php on line 75</pre></td></tr></tbody></table></div></td></tr></tbody></table> When you encounter a PHP parsing error, the error line number will correspond to the compiled PHP script, NOT the template itself. Usually you can look at the template and spot the syntax error. Here are some common things to look for: missing close tags for {if}{/if} or {section}{/section} , or syntax of logic within an {if} tag. If you can't find the error, you might have to open the compiled PHP file and go to the line number to figure out where the corresponding error is in the template. 當你遇到一個php解析錯誤時,錯誤行號反映的php編譯腳本,而不是模板本身(雖然實際情況是模板有誤,但錯誤機制只反映在php編譯腳本)。一般情況下,你只須查看模板并發現錯誤語法。這里提供一些常見的錯誤:缺少{if}{/if}或者{section}{/section}的閉合標簽,或者{if}標簽內的邏輯語法錯誤。如果你不能在模板中發現錯誤,那就可能需要打開php編譯文件,然后查看行號,并返回模板找出相應的錯誤。 **Example 17.3. Other common errors** **例17-3.其他常見錯誤** <table width="100%" bgcolor="#e0e0e0" border="0"><tbody><tr><td><pre class="PROGRAMLISTING">Warning: Smarty error: unable to read resource: "index.tpl" in...orWarning: Smarty error: unable to read resource: "site.conf" in...</pre> <li>The $template_dir is incorrect, doesn't exist or the file index.tpl is not in the templates/directory</li> <li>$template_dir不正確,不存在或index.tpl文件不在templates/目錄下</li> <li>A {config_load} function is within a template (or config_load() has been called) and either $config_dir is incorrect, does not exist or site.conf is not in the directory.</li> <li>{config_load}函數在模板中(或調用了configLoad()),并且$config_dir不正確,不存在或site.conf不在目錄中。<br/><br/><br/> Fatal error: Smarty error: the $compile_dir 'templates_c' does not exist,or is not a directory...<br/><br/></li> <li>Either the $compile_dir is incorrectly set, the directory does not exist, or templates_c is a file and not a directory.</li> <li> 要么$compile_dir設置錯誤,目錄不存在,要么templates_c只是個文件,而非目錄。<br/><br/><br/> Fatal error: Smarty error: unable to write to $compile_dir '....<br/><br/></li> <li>The $compile_dir is not writable by the web server. See the bottom of the installing smarty page for more about permissions.</li> <li> $compile_dir在服務器中不可寫。關于權限瀏覽Smarty安裝頁面底部。<br/><br/><br/> Fatal error: Smarty error: the $cache_dir 'cache' does not exist,or is not a directory. in /..<br/><br/></li> <li>This means that $caching is enabled and either; the $cache_dir is incorrectly set, the directory does not exist, or cache/ is a file and not a directory.</li> <li> 這意味著$caching被激活同時$cache_dir設置錯誤、目錄不存在或者cache/是一個文件而非目錄。<br/><br/><br/> Fatal error: Smarty error: unable to write to $cache_dir '/...<br/><br/></li> <li>This means that $caching is enabled and the $cache_dir is not writable by the web server. See the bottom of the installing smarty page for permissions.</li> <li> 這意味著$caching被激活同時$cache_dir在服務器中不可寫。關于權限瀏覽Smarty安裝頁面底部。</li></td> </tr></tbody></table> 參見[debugging](#)。 <table cellspacing="0" cellpadding="0" width="100%" summary="Footer navigation table" border="0"><tbody><tr><td valign="top" align="left" width="33%"><a accesskey="P" href="appendixes.html">Prev</a></td> <td valign="top" align="center" width="34%"><a accesskey="H" href="index.html">Home</a></td> <td valign="top" align="right" width="33%"><a accesskey="N" href="tips.html">Next</a></td></tr><tr><td valign="top" align="left" width="33%"> Appendixes<br/>附錄 </td> <td valign="top" align="center" width="34%"><a accesskey="U" href="appendixes.html">Up</a></td> <td valign="top" align="right" width="33%"> Tips &amp; Tricks<br/>使用技巧和經驗 </td></tr></tbody></table>
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看