将文件从网络服务器

时间:2016-02-02 18:51:25

标签: php ftp

我正在尝试使用PHP和网络服务器将文件写入本地共享。该文件的来源是webserver ubuntu01,本地机器7PD01-2012上的共享是要写入文件的位置。路径" ftp://ryan:pass@7PD01-2012//file.txt"当我将它放入Web浏览器并显示文件内容时解析。似乎没有权限问题。我能够从客户端和Web服务器的客户端ping网络服务器。 FTP安装在我的ubuntu网络服务器上,Filezille ftp Server安装在客户端上。使用filezilla或浏览器,我可以ftp到两个位置。我在Web服务器上设置了防火墙规则并更新了/ etc / hosts文件。可能导致这些错误的任何想法?

        $fileName = "ftp://ryan:pass@7PD01-2012//file.txt";
        is_dir($fileName);
        if (($myfile = fopen($fileName, "w")) === false) { //open the file
            //if unable to open throw exception
            throw new RuntimeException("Could Not Open File Location on Server.");
        }

(!)警告:is_dir():connect()失败:连接在第143行的/var/www/html/CDprinter/processor.php中超时

(!)警告:fopen():connect()失败:第144行/var/www/html/CDprinter/processor.php中的连接超时

(!)警告:fopen(ftp://...@10.162.12.130//file.txt):无法打开流:第144行/var/www/html/CDprinter/processor.php中的操作失败

0 个答案:

没有答案