是的,你需要在你的app_dev.php
註釋掉以下行:
// This check prevents access to debug front controllers that are deployed by accident to production servers.
// Feel free to remove this, extend it, or make something more sophisticated.
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'))
) {
header('HTTP/1.0 403 Forbidden');
exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.');
}
林假設您嘗試訪問您的dev
環境?默認情況下它不允許從比其他主機連接127.0.0.1
注:這些行的註釋去掉,或文件沒有被放置在生產服務器上 - 因爲這將使你的開發環境遠程
訪問謝謝你的幫助!它現在有效。 – jmdesigner81
@ jmdesigner81請確保您接受所有您在StackOverflow上提出的問題的答案 - 您接受並通過單擊答案旁邊的勾號來回答 – ManseUK
謝謝!我接受了。 – jmdesigner81