How do I access to symfony config.php remotely?

我只是一个虾纸丫 提交于 2019-11-28 06:34:59

问题


I have set up Symfony in bitnami on Amazon EC2. Now I want to access web/config.php, but was told the file can only be run via localhost.

And I also tried to log on remote desktop of EC2, but failed. So now how can I ensure symfony is all good on server?


回答1:


Open config.php and edit following code

if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
    '127.0.0.1',
    '::1',
))) {
    header('HTTP/1.0 403 Forbidden');
    exit('This script is only accessible from localhost.');
}

You can either add the IP Address oft the remote server or just comment out this piece of code. Consider the last advice is not recommended for security reasons.




回答2:


First use htpasswd to protect your production site. Edit the file config.php and remove.



来源:https://stackoverflow.com/questions/12870243/how-do-i-access-to-symfony-config-php-remotely

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!