2016-05-17 33 views
0

我想從另一個網站讀取文件的內容,但無法讀取它。 我可以訪問這兩個主機。 我想用file_get_contents()函數。我需要在文件或文件夾的文件目錄中進行更改?或在我的PHP文件? enter link description here超時時我想要使用file_get_contents()

<?php $direct="http://nic.subz.ir/api/index.php"; echo $direct; echo file_get_contents($direct); ?>

+2

請提供您正在訪問的代碼和示例鏈接。您是否無法使用file_get_contents()獲取數據; ? –

+0

是的。我無法訪問數據[code] $ direct =「http://nic.subz.ir/api/index.php」; echo $ direct; echo file_get_contents($ direct); [/ code] http://services.khazrait.ir/feeds/te.php –

回答

0

在這裏寫下你的榜樣和錯誤你會得到什麼。 如果有關於權限的問題,請在您的請求中發送用戶代理

+0

我編輯了我的問題。我爲文件644和777以及foder(目錄)755和777設置chmod,並且禁用了modsecurity,同樣,htaccess通過「allow all」 –