Navigation

    Netgate Discussion Forum
    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search

    FTP Zugriff über PHP Script scheitert

    Deutsch
    2
    7
    5297
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • R
      racer354 last edited by

      Hallo zusammen,

      ich nutze pfsense 1.2.1-RC4.
      Betreibe einen FTP Server (pure FTP) im LAN der auch über WAN erreichbar ist. Funktioniert alles bestens solange man für den FTP-Zugriff einen FTP Clienten nutzt.
      Jetzt versuche ich per PHP script über eine externe website Zugriff auf den Server zu bekommen.
      Das scheitert jedoch jedesmal an einem timeout. Da der Zugriff über FileZilla und co ohne Probleme funktioniert und das php-script mit anderen Servern auch klappt, denke ich es könnte an pfsense liegen.
      Das Seltsame ist das über php eine Verbindung zum Server aufgebaut und auch noch in den Passive Mode gewechselt wird.
      In der Log von pfsense erscheint die Verbindung auch als durchgelassen.
      Er läd bloß die files nicht auf den Server.

      Fehlermeldung:
      Warning: ftp_put() [function.ftp-put]: php_connect_nonb() failed: Connection timed out (110) in /www/htdocs/****/upload.php on line 44

      Warning: ftp_put() [function.ftp-put]: TYPE is now 8-bit binary in /www/htdocs/****/upload.php on line 44
      Ein Fehler trat beim Hochladen von test.txt auf!

      Zeile 44 des scripts:
      if (ftp_put($conn_id, $file, $temp, FTP_BINARY)) {

      Wie schon gesagt, das Script funzt auf anderen Servern ohne Probleme, der FTP Server mittels Client auch.
      Hat jemand ne Idee?

      Es könnte evtl auch an der config von pure FTP liegen. Aber da hab ich auch schon so ca alles ausprobiert.
      Bei Bedarf poste ich das gesamte php script und die pure FTP conf.

      Danke schonmal,
      racer354

      1 Reply Last reply Reply Quote 0
      • A
        Aleum last edited by

        Funktioniert auch komplett von Extern auf den FTP-Server? Evtl. sind die passive-Ports nicht freigebeben im NAT?

        1 Reply Last reply Reply Quote 0
        • R
          racer354 last edited by

          Funktioniert ohne Probleme von extern über FTP-Client.
          Passive Ports sind frei, er verbindet auch und wechseln in den Passive-Mode mit dem php-script.
          Erst der upload scheitert.

          1 Reply Last reply Reply Quote 0
          • A
            Aleum last edited by

            @racer354:

            Funktioniert ohne Probleme von extern über FTP-Client.
            Passive Ports sind frei, er verbindet auch und wechseln in den Passive-Mode mit dem php-script.
            Erst der upload scheitert.

            Ich kann mir vorstellen, dass Übetragungsmodus nicht korrekt ist. Kannst Du auf "automatisch" gehen? Den eine TXT-Datei binär ist nicht besonders sinvoll, eher ASCII.

            1 Reply Last reply Reply Quote 0
            • R
              racer354 last edited by

              habs auch mit ASCII probiert. Geht auch nicht.

              aber auch andere befehle wie ftp_list() oder ftp_get() funktioniert nicht. bringt den gleichen fehler. also muß es irgendwie an der verbindung mit dem server liegen.
              aufgebaut wird sie definitiv…
              aber mehr nicht. :(

              1 Reply Last reply Reply Quote 0
              • R
                racer354 last edited by

                So, hab das Problem gefunden.
                Falls es noch jemanden interessiert, es lag nicht an pfsense, sondern die Passive IP Adresse in der pure FTP config war nicht korrekt. Es gehört die Serveradresse rein.

                Gruß,
                racer354

                1 Reply Last reply Reply Quote 0
                • A
                  Aleum last edited by

                  @racer354:

                  So, hab das Problem gefunden.
                  Falls es noch jemanden interessiert, es lag nicht an pfsense, sondern die Passive IP Adresse in der pure FTP config war nicht korrekt. Es gehört die Serveradresse rein.

                  Gruß,
                  racer354

                  Okay, das ist eine Erklärung. Vielen Dank für Rückmeldung.

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  Products

                  • Platform Overview
                  • TNSR
                  • pfSense
                  • Appliances

                  Services

                  • Training
                  • Professional Services

                  Support

                  • Subscription Plans
                  • Contact Support
                  • Product Lifecycle
                  • Documentation

                  News

                  • Media Coverage
                  • Press
                  • Events

                  Resources

                  • Blog
                  • FAQ
                  • Find a Partner
                  • Resource Library
                  • Security Information

                  Company

                  • About Us
                  • Careers
                  • Partners
                  • Contact Us
                  • Legal
                  Our Mission

                  We provide leading-edge network security at a fair price - regardless of organizational size or network sophistication. We believe that an open-source security model offers disruptive pricing along with the agility required to quickly address emerging threats.

                  Subscribe to our Newsletter

                  Product information, software announcements, and special offers. See our newsletter archive to sign up for future newsletters and to read past announcements.

                  © 2021 Rubicon Communications, LLC | Privacy Policy