2016-05-17 70 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” –