I'm trying to start a new project with Symfony2. I started with a simple Hello world. Controller:
class DefaultController extends Controller
{
public function indexAction()
{
$name = 'world';
return $this->render('MyowntestBundle:Default:index.html.twig', array('name' => $name));
}
}
View:
{% extends "::base.html.twig" %}
{% block body %}
Hello {{ name }}!
{% endblock %}
When i open site through app.php
everything is ok, but opening app_dev.php
results in a blank, white page. Nothing in apache main error log, nothing in vhost error log and app/logs/dev.log
is empty too.
Whats wrong?
app_dev only works when testing on the same server. meaning you're on your WAMP/XAMP etc..
To enable using app_dev.php, open it and comment out the following:
if (isset($_SERVER['HTTP_CLIENT_IP'])
|| isset($_SERVER['HTTP_X_FORWARDED_FOR'])
|| !in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', 'fe80::1', '::1'))
) { header('HTTP/1.0 403 Forbidden'); exit('You are not allowed to access this file. Check '.basename(FILE).' for more information.'); }
you can find app_dev.php in the web/app_dev.php directory.
Good luck !
Problems gone after updating PHP to 5.4. Dont know what was exactly wrong.