snipt

Ctrl+h for KB shortcuts

Text only

Symfony 1.x : Add Error 500 page

1
2
3
4
5
6
7
Add the file error.html.php in /config/error

To test it, add this in your action:
throw new sfException('Testing the 500 error');

To see it don't forget to set your $debug at false in your front controller:
$configuration = ProjectConfiguration::getApplicationConfiguration('frontend', 'dev', false);
https://snipt.net/embed/8c3aa50151a5ace72a2f03c71c332a23/
/raw/8c3aa50151a5ace72a2f03c71c332a23/
8c3aa50151a5ace72a2f03c71c332a23
text
Text only
7
2016-12-19T09:28:25
True
False
True
Oct 12, 2012 at 09:58 AM
/api/public/snipt/47349/
symfony-1x-error-500-prod
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a> <a href="#L-6">6</a> <a href="#L-7">7</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>Add the file error.html.php in /config/error </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a>To test it, add this in your action: </span><span id="L-4"><a name="L-4"></a>throw new sfException(&#39;Testing the 500 error&#39;); </span><span id="L-5"><a name="L-5"></a> </span><span id="L-6"><a name="L-6"></a>To see it don&#39;t forget to set your $debug at false in your front controller: </span><span id="L-7"><a name="L-7"></a>$configuration = ProjectConfiguration::getApplicationConfiguration(&#39;frontend&#39;, &#39;dev&#39;, false); </span></pre></div> </td></tr></table>
"error 500", Symfony