专注于Magento开发与外贸SEO推广
Magento主题|Magento插件|Magento教程

symfony应用报错You are not allowed to access this file. Check app_dev.php for more information.

symfony应用报错You are not allowed to access this file. Check app_dev.php for more information.

解决办法

if (isset($_SERVER['HTTP_CLIENT_IP'])
    || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
    || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1', '192.168.56.1']) || php_sapi_name() === 'cli-server')
) {
    header('HTTP/1.0 403 Forbidden');
    exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information. Your IP: ' . $_SERVER['REMOTE_ADDR']);
}

修改代码, 然后可以查看到自己的IP ,然后把IP 改为

if (isset($_SERVER['HTTP_CLIENT_IP'])
     || isset($_SERVER['HTTP_X_FORWARDED_FOR'])
     || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '192.168.33.1', 'fe80::1', '::1', '192.168.56.1']) || php_sapi_name() === 'cli-server')
 ) {
     header('HTTP/1.0 403 Forbidden');
     exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information. Your IP: ' . $_SERVER['REMOTE_ADDR']);
 }

看到里面加的IP 192.168.33.1

未经允许不得转载:Magento|Magento2|magento开发|magento插件|magento主题|magento模板|magento商城|magento维护 » symfony应用报错You are not allowed to access this file. Check app_dev.php for more information.
分享到: 更多 (0)

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

Magento开发|Magento咨询QQ283475615

联系我们