0

Hello I create my vagrant setup by link. And server is up i can manage to go my example.com/web/app_dev.php/controller/... and its works all well when i comment in my app_dev.php

   // header('HTTP/1.0 403 Forbidden');
    //exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');

but when i want to go site example.com/web/controller/.... its display blank 404 error what might be the problem ? I do not use 127.0.0.1 insted of i use deflaut from setup 192.168.56.101

network:
    private_network: 192.168.56.101
    forwarded_port:
        9DcLNVHGAeca:
            host: '8889'
            guest: '22'

What can i do to solve this ?

user2217288
  • 529
  • 2
  • 14
  • 26

1 Answers1

0

You can either add your local IP to the array in the app_dev.php line 14:

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', 'YOUR IP')) 
    || php_sapi_name() === 'cli-server')
)

or just uncomment the statements as you did in your question. It should be noted that the app_dev.php should not be reachable on your production server anyways because it reveals sensitive information about your setup.

ferdynator
  • 6,245
  • 3
  • 27
  • 56
  • ok but why I have 404 when link 'web/example/' and 'web/app_dev.php/example/' working well ? – user2217288 Oct 09 '14 at 20:44
  • Accessing `web/example` will access the production environment. Make sure to deploy your production mode correctly as [described here](http://stackoverflow.com/a/9262632/1847340). – ferdynator Oct 09 '14 at 20:50