我正在尝试通过file_get_contents从公共ftp服务器获取一个文件。
$url = 'ftp://ftp.server.de/my_file.txt';
echo file_get_contents($url);我得到以下错误:
file_get_contents(): connect() failed: No route to host启用了allow_url_fopen。
有什么问题吗?
发布于 2014-07-24 11:06:07
是防火墙问题。
PHP包装器只使用被动模式。所以所有的港口都必须开放。
发布于 2014-07-21 12:21:56
$url = 'www://ftp.server.de/my_file.txt';
$file = file_get_contents($url, true);尝尝这个
https://stackoverflow.com/questions/24864784
复制相似问题