我想從一個URL包含一個文件,但是我得到了下面的錯誤。get around allow_url_include = 0錯誤
Warning: include(): http:// wrapper is disabled in the server configuration by allow_url_include=0 in /Applications/MAMP/htdocs/diningtime/testsite/salims/index1.php on line 58
Warning: include(http://localhost/diningtime/templates/100/index.php): failed to open stream: no suitable wrapper could be found in /Applications/MAMP/htdocs/diningtime/testsite/salims/index1.php on line 58
Warning: include(): Failed opening 'http://localhost/diningtime/templates/100/index.php' for inclusion (include_path='.:/Applications/MAMP/bin/php/php5.4.4/lib/php') in /Applications/MAMP/htdocs/diningtime/testsite/salims/index1.php on line 58
Test
只是想知道是否有這個嗎?
我的PHP包括代碼是
<?php include "$location/index.php"; ?>
我很欣賞你這個幫助。
爲什麼要通過HTTP請求而不是通過本地文件路徑從同一服務器「包含」文件?你有*需要*做出HTTP請求嗎? – deceze
是的,當網站正在運行時,它將從另一臺服務器上拉出來,所以我需要測試這個概念。 – AppleTattooGuy
假設這是一個遠程文件,而不是欺騙指出只是一個錯誤包含的本地文件...你問如何啓用它? 'ini_set('allow_url_include',1);'或編輯你的php.ini文件。 – ficuscr