如何远程访问symfony的config.php文件? [英] How do I access to symfony config.php remotely?
本文介绍了如何远程访问symfony的config.php文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已成立的Symfony在汇出在Amazon EC2上。现在,我要访问网络/ config.php文件
,但被告知该文件只能通过本地主机上运行。
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.
和我也尝试登录EC2的远程桌面上,但没有成功。所以,现在我怎么能保证symfony的是所有好的服务器?
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?
推荐答案
打开的config.php
和编辑以下code
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.');
}
您可以添加IP地址经常远程服务器或只是注释掉这片code。考虑到最后的意见是不建议出于安全考虑。
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.
这篇关于如何远程访问symfony的config.php文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文