0

i have this php Script:

function GetFTPFile($iFile) {
        echo '<pre>';
        $StartTime   = microtime(true);
        $FTP         = [];
        $FTP['SMG']  = '';
        $FTP['st']   = 0;
        $FTP['time'] = 0;
        $nuevo_path  = $iFile['lfile'];
        $remote      = $iFile['sfile'];
        echo $P_Path      = 'ftp://' . FTP_USER . ':' . FTP_PASSWORD . '@' . FTP_HOST . $remote;
        echo '<br>';
        $FTP['test'] = $P_Path;
        $result      = file_exists($P_Path);
        if ($result == true) {
            $resultfile = copy($P_Path, $nuevo_path);
            if ($resultfile == true) {
                $FTP['SMG'] = 'Copy Successfull';
                $FTP['st']  = 1;
            } else {
                $FTP['SMG'] = 'Copy Fail!!!';
                $FTP['st']  = 0;
            }
        } else {
            $FTP['SMG'] = 'Conection Error!!!';
            $FTP['st']  = 0;
        }
        $EndTime     = microtime(true);
        echo 'Copy time via FTP: <br>';
        echo $FTP['time'] = $EndTime - $StartTime;
        echo '</pre>';
        return $FTP;
    }

and this create a FTP URI Like this

ftp://user:secretpass@xxx.xxx.xxx.xxx/dir1/dir2/repository/test.txt

And try to copy a txt File around 85 Kb from the FTP Server (UNIX SCO 5.05) to local Disk (Linux Ubuntu Server 18.04 with php 7.2) both server are over a Tunel (FE) LAN with 50 kms distance (network testing is at the end of the post).

the issues is that this is taken around 15-20 second to run the script over the file with the native function copy().

i try to make the connection over FTP client Filezilla to get the log and get this, i dont know if its relation to this:

11:16:08 Status: Connecting to 192.168.2.10:21 ... 
11:16:08 Status: Connection established, waiting for the welcome message ...
11:16:22 Status: Server not secure, does not support FTP over TLS. 
11:16:22 Status: The server does not allow non-ASCII characters.**
11:16:22 Status: Registered at 
11:16:22 Status: Retrieving the directory listing ... 
11:16:22 Status: Directory "/ usr / intlu" listed correctly

i try to use play text in filezilla and get this:

17:21:19 Status: Connecting to 192.168.2.10:21 ...
17:21:19 Status: Connection established, waiting for the welcome message ...
17:21:32 Status: Registered in
17:21:32 Status: Retrieving the directory listing ...
17:21:32 Status: Directory "/ usr / intlu" listed correctly

Log File TXT:

2019-07-29 17:48:46 9868 1  Status: Connecting to 192.168.2.10:21 ...
2019-07-29 17:48:46 9868 1  Status: Connection established, waiting for the welcome message ...
2019-07-29 17:48:59 9868 1  Answer: 220-
2019-07-29 17:48:59 9868 1  Answer: 220 pasherma.avipac.com FTP Server (Version wu-2.6.2 (1) Tuesday February 18 02:26:24 PST 2003) ready.
2019-07-29 17:48:59 9868 1  Command: USER intlu
2019-07-29 17:48:59 9868 1  Answer: 331 Password required for intlu.
2019-07-29 17:48:59 9868 1  Command: PASS ********
2019-07-29 17:48:59 9868 1  Answer: 230 Intlu user connected.
2019-07-29 17:48:59 9868 1  Command: SYST
2019-07-29 17:48:59 9868 1  Answer: 215 UNIX Type: L8 (SCO OpenServer Release 3.2v5.0.7 from 2003-02-18)
2019-07-29 17:48:59 9868 1  Command: FEAT
2019-07-29 17:48:59 9868 1  Answer: 500 'FEAT': command not understood.
2019-07-29 17:48:59 9868 1  Status: Registered in
2019-07-29 17:48:59 9868 1  Status: Retrieving the directory listing ...
2019-07-29 17:48:59 9868 1  Command: PWD
2019-07-29 17:48:59 9868 1  Answer: 257 "/ usr / intlu" is the current directory.
2019-07-29 17:48:59 9868 1  Command: TYPE I
2019-07-29 17:48:59 9868 1  Answer: 200 Type set in I.
2019-07-29 17:48:59 9868 1  Command: PASV
2019-07-29 17:48:59 9868 1  Answer: 227 Entering passive mode (192,168,2,10,95,54)
2019-07-29 17:48:59 9868 1  Command: LIST
2019-07-29 17:48:59 9868 1  Answer: 150 Opening the data connection in BINARY mode for / bin / ls.
2019-07-29 17:48:59 9868 1  Answer: 226 Full transfer.
2019-07-29 17:48:59 9868 1  Status: Directory "/ usr / intlu" correct listing
2019-07-29 17:49:03 9868 1  Status: Disconnected from server

which is what I am omitting, how can I decrease this delay or how to solve it?

What program can I use to find the problem that is so delaying the welcome message?

I guess this is already a network issue; but I do not detect that it may be causing it, I leave images attached below.

If it is the unix server, what should I look for in it?

Other server with Ubuntu from 2009 and php 5.3.1 does not have this type of delay.

2019-07-29 17:48:46 9868 1  Status: Connection established, waiting for the welcome message ...
    2019-07-29 17:48:59 9868 1  Answer: 220-????

------------UPDATE With Solution but New Question--------------------

I fin the solution to it:

1. On the client side (Laptop, PC, Tablet, servers [clients]) port 113 must be released, which is related to the TCP INETD service (Authentication Service / Identification Protocol), which facilitates the connection (used for testing 2 second filecopy). https://www.grc.com/port_113.htm

2. On the Server side (On the FTP provider server: recommended): --- >>>>> Continued (I don't know if this can be done on UNIX). for example the proftpd software is used; and the related file is proftpd.conf where the instruction set is added:

The 'perfect setup' howto says that the following lines should be added to proftpd.conf:

DefaultRoot ~
IdentLookups off
ServerIdent on "FTP Server ready."

BUT IF ADDED LIKE THIS, THE CHANGES WILL NOT AFFECT THE VIRTUAL HOSTS!

So actually it should be like this:

<Global>
DefaultRoot ~
IdentLookups off
ServerIdent on "FTP Server ready."
</Global>

How can i get this on UNIX SCO 5.05???

LINK Related: https://www.unix.com/sco/282416-config-ftp-sco-like-proftpd.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.