No later than this morning was I trying to use my Symfony dev environment from a different PC on the network, and came across the following error:
You are not allowed to access this file. Check xxxxx_dev.php for more information.
Well, to every simple problem it seems there is a simple solution :).
Just open xxxxx_dev.php and add the relevant IP address to the array as follows:
if (!in_array(@$_SERVER['REMOTE_ADDR'], array('127.0.0.1', '192.168.254.102', '::1')))
{
die('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}
Obviously you probably wouldn't want to do this on a public server but it's neat for LAN use all the same and I am just literally more and more impressed with all the inbuilt mechanisms that symfony has to offer!
Thoughts?
This post first appeared on The Blog That Refused To Throw NPE, please read the originial post: here