专注于Magento开发与外贸营销推广
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

赞(0) 打赏
未经允许不得转载:Magento电子商务专家 » symfony应用报错You are not allowed to access this file. Check app_dev.php for more information.
分享到: 更多 (0)

评论 抢沙发

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

Magento开发 & Magento咨询 联系QQ283475615

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏