Location: PHPKode > projects > Open Power Template > docs/Opt/appendix.possible-problems.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="pl">
<head>
	<meta http-equiv="content-type" content="text/html; charset=utf-8" />
	<meta name="robots" content="all" />

	<title>Possible problems - Open Power Template</title>
	
	<link rel="stylesheet" type="text/css" href="design/generic.css" media="all"  />
	<link rel="stylesheet" type="text/css" href="design/print.css" media="print" />
	<!--[if lte IE 6]><link rel="stylesheet" href="design/ie.css" type="text/css" /><![endif]-->	
	<!--[if IE 7]><link rel="stylesheet" href="design/ie7.css" type="text/css" /><![endif]-->
</head>
<body>

<div id="wrap">
	<div id="header">
		<h1>Open Power Template 2.0</h1>
		<h2>Possible problems</h2>
		<p class="generated">@ 02.09.2010</p>
		<p class="location"><a href="index.html"><strong>User manual</strong></a> &raquo; <a href="appendix.html">Appendix</a> &raquo; <a href="appendix.possible-problems.html">Possible problems</a></p>
	</div>
	
	<div id="content"><dl class="location"><dt><a href="appendix.html">8. Appendix</a><br/>C. Possible problems</dt><dd class="prev">B. Error messages<br/><a href="appendix.error-messages.html">&laquo; Previous</a></dd><dd class="next">D. Support<br/><a href="appendix.support.html">Next &raquo;</a></dd></dl>	<h1>Appendix C. Possible problems</h1><h3>After update, my templates generate PHP errors</h3>

<p>This may happen, if there were changes in the structure of the PHP code generated by OPT. We recommend to clean the template compilation cache (pointed by <code>compileDir</code> configuration option) after updating OPT and let the compiler rebuild it.</p>

<h3>The script data are not displayed</h3>

<p>OPT does not report such events like undefined template variable. Be sure that you do not make a mistake in the section/variable name both in the template and in the script. You can also change the default error reporting level for the template execution <code>errorReporting</code>:</p>

<pre class="php"><span style="color: #000088;">$tpl</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">errorReporting</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">E_ALL</span> <span style="color: #339933;">|</span> <span style="color: #009900; font-weight: bold;">E_NOTICE</span><span style="color: #339933;">;</span></pre>

<p>However, in this case the templates might still display some internal notices.</p>

<h3>After running a script with OPT I see the blank page.</h3>

<p>In 99% cases the reason are some strange settings of Gzip compression in your web server. Try simply to disable such compression in OPT:</p>

<pre class="php"><span style="color: #000088;">$tpl</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">gzipCompression</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span></pre>

<h3>I get a message "Exception thrown without a stack frame".</h3>

<p>Neither OPT nor any other script that throws exceptions should be used in destructors. If the destructor is called during the finishing the script and some code throws an exception then, we get this message. There are two possible solutions:</p>

<ul>
<li>Do not use OPT in destructors.</li>
<li>Sanitize the destructor by capturing the exceptions:</li>
</ul>

<pre class="php"><span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __destruct<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    try
    <span style="color: #009900;">&#123;</span>
        <span style="color: #666666; font-style: italic;">// Some dangerous code.</span>
    <span style="color: #009900;">&#125;</span>
    catch<span style="color: #009900;">&#40;</span>Opt_Exception <span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span>
    <span style="color: #009900;">&#123;</span>
        Opt_Error_Handler<span style="color: #009900;">&#40;</span><span style="color: #000088;">$e</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// end __destruct();</span></pre>
<dl class="location location-bottom"><dt>C. Possible problems<br/><a href="appendix.html">8. Appendix</a></dt><dd class="prev"><a href="appendix.error-messages.html">&laquo; Previous</a><br/>B. Error messages</dd><dd class="next"><a href="appendix.support.html">Next &raquo;</a><br/>D. Support</dd></dl>		</div>
	
	<div id="footer">
		<p>Copyright &copy; <a href="http://www.invenzzia.org/">Invenzzia Group 2008-2009</a></p>
		<p>Available under the terms of license: <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation License 1.2</a></p>
		<p>Generated by <strong>TypeFriendly 0.1.4</strong> by <a href="http://www.invenzzia.org/">Invenzzia</a></p>
	</div>
</div>

</body>
</html>
Return current item: Open Power Template