PHP将Scandir与外部URL结合使用-未实现 [英] PHP Using Scandir with and External URL - Not Implemented

查看:93
本文介绍了PHP将Scandir与外部URL结合使用-未实现的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用scandir时遇到了一些麻烦-我可以在一个站点上正常工作,但是现在我想从另一个网站上扫描该站点上的同一目录.

I'm having some trouble using scandir - I have it working fine on one site but now I'm wanting to scan the same directory on that site but from a different website.

我正在使用以下代码:

array_diff(scandir('http://sub.domain.co.uk/folder/folder/'), array('.', '..'));

我得到这个错误:

Warning: scandir(http://sub.domain.co.uk/folder/folder/): failed to open dir: not implemented

我曾经有一个Google,但是带来的却很少-我已经尝试在外部站点上启用目录列表,并且还启用了allow_fopen_url.

I've had a Google but brought up very little - I've tried enabling directory listing on the external site and allow_fopen_url is enabled as well.

我很困惑,对此有什么帮助吗?

I'm stumped, any help with this one?

推荐答案

这原来是一个回送问题,我试图扫描主机不允许的同一域中的文件夹.

This turned out to be a loop back problem, I was trying to scan a a folder on the same domain which was not allowed with my host.

我必须引入一个状态"来处理此问题,该状态说明该软件是否处于活动状态(因为该软件一旦发布,实际上将指向另一个域).

I've had to introduce a 'state' to deal with this which says whether the software is live or not (because the software, once live, will actually point to a different domain).

这篇关于PHP将Scandir与外部URL结合使用-未实现的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆