0

我刚开始用phing。下面是我的代码。没有关于连接的错误。它给出的唯一错误是文件无法上传

我不知道如何解决这个问题。我的意思是我真的不能用这个小信息来调试它。谁能告诉如何调试这个?奇怪的是 phing 能够创建/上传文件夹,但无法在该文件夹中上传文件。我在这里错过了什么吗?

<?xml version="1.0" encoding="UTF-8"?>
<project name="HelloWorld" default="deploy" basedir="." description="a demo project">
 <property name="message" value="Hello World!"/>
 <property name="builddir" value="build"/>
 <property name="srcDir" value="src"/>
 <property name="ftp.destination.host" value="<host>"/>
 <property name="ftp.destination.port" value="<port>"/>
 <property name="ftp.destination.username" value="<user>"/>
 <property name="ftp.destination.password" value="<pass>"/>
 <property name="ftp.destination.dir" value="/upload"/>
 <property name="ftp.destination.mode" value="binary"/>

 <target name="deploy">
    <echo msg="preparing local build directory..." />
    <delete dir="${builddir}" />
    <mkdir dir="${builddir}" />
    <copy todir="${builddir}" overwrite="true">
        <fileset dir="./" id="Files">
            <include name="**" />
            <exclude name="build/" />
            <exclude name="build.*" />
            <exclude name="docs/" />
            <exclude name="tests/" />
        </fileset>
    </copy>

    <echo msg="FTPing up build..." />
    <ftpdeploy
        host="${ftp.destination.host}"
        port="${ftp.destination.port}"
        username="${ftp.destination.username}"
        password="${ftp.destination.password}"
        dir="${ftp.destination.dir}"
        mode="${ftp.destination.mode}" >
        <fileset dir="${builddir}">
            <include name="**" />
        </fileset>
    </ftpdeploy>

    <echo msg="Site deployed..." />
</target>


</project>
4

1 回答 1

2

尝试添加属性

passive="true"

在 ftpdeploy 标记中。

于 2014-08-04T21:18:35.870 回答