Symfony 2 : This script is only accessible from localhost / You are not allowed to access this file

Vous voulez accèder au fichier app_dev.php ou config.php de votre application Symfony 2, mais vous avez l'erreur "This script is only accessible from localhost" ou "You are not allowed to access this file".
Récupérer votre IP et ajouter là dans le fichier app_dev.php et config.php en modifiant le code ci-dessous:
if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
    '127.0.0.1',
    '::1',
	'MONIP'
))) {
    header('HTTP/1.0 403 Forbidden');
    exit('This script is only accessible from localhost.');
}
This entry was posted in Uncategorized. Bookmark the permalink.

One Response to Symfony 2 : This script is only accessible from localhost / You are not allowed to access this file

  1. Pingback: Rodbox - blog | Symfony Installation online part 1