Hi, I have been trying a whole day to fix a crashing problem; it narrows down to volt engine. The website renders fine on my virtual box, but on my VPS volt always crash whenever it renders a view.
Is there an easy way to debug volt crashes?
- tried to upgrade & disable xdebug, not working
- applied all updates for php5.5 and centos
Error message: 502 Bad Gateway
The most headache part is, it works okay on my virtual box with almost the same setup.
Here is the phpinfo() from the server crashes: https://dovps1.woapp.info/pi.php
It is very smimilar to my dev box. Same Kernel version, php, phalcon.
The Controller and Vews are really simple, just a 1 line test case:
class IndexController extends \Phalcon\Mvc\Controller
{
public function indexAction()
{
echo __FUNCTION__." in ".__FILE__." at ".__LINE__."<br/>";
$this->view->pick("test");
}
test.volt
<html>
<body>
<h3>This is VOLT view!</h3>
</body>
</html>
Here is how I register volt:
$di->set('view', function() {
$view = new \Phalcon\Mvc\View();
$view->setViewsDir(__DIR__.'/views/');
//$view->setTemplateBefore('main');
$view->registerEngines(array(
".volt" => function($view, $di) {
$volt = new \Phalcon\Mvc\View\Engine\Volt($view, $di);
$volt->setOptions(array(
"compiledPath" => DIR_ROOT."/var/volt/",
"compiledExtension" => ".php",
'compiledSeparator' => '_',
"compileAlways" => false
));
return $volt;
},
'.phtml' => 'Phalcon\Mvc\View\Engine\Php' // Generate Template files uses PHP itself as the template engine
));
return $view;
}, true);
Thanks!