Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
[Bug report]FTP core class
  • Hi there,

    I got error message when I try to forge new ftp object twice like following.

    $ftp = \Ftp::forge(array(
                        'hostname' => 'ftp.example',
                        'username' => 'u',
                        'password' => 't',
                        'timeout'  => 5,
                        'port'     => 21,
                        'passive'  => true,
                        'ssl_mode' => false,
                        'debug'    => false
                            ), false);
    $ftp->connect();
    $ftp->close();
    $ftp = \Ftp::forge(array(
                        'hostname' => 'ftp.example',
                        'username' => 'u',
                        'password' => 't',
                        'timeout'  => 5,
                        'port'     => 21,
                        'passive'  => true,
                        'ssl_mode' => false,
                        'debug'    => false
                            ), false);

    The error message is as following.
    Parse Error - Invalid connection 

    Am I doing wrong way?
  • Any more details?

    What Fuel version? What line triggers this message? What is the error exactly, is it a PHP error, an Exception?
  • Fuel version is 1.8.
    ubuntu16.04
    PHP 7.0.22
    It looks like the error comes from line 171.

  • The Fuel error page should display the exact filename and line number, and a backtrace?
  • I can't reproduce it here.

    Test code:

    $ftp = \Ftp::forge(array(
        'hostname' => '172.16.1.43',
        'username' => 'root',
        'password' => 'pass',
        'timeout'  => 5,
        'port'     => 21,
        'passive'  => true,
        'ssl_mode' => false,
        'debug'    => false
    ), false);
    $ftp->connect();
    var_dump($ftp);
    $ftp->close();
    $ftp = \Ftp::forge(array(
         'hostname' => '172.16.1.43',
        'username' => 'root',
        'password' => 'pass',
        'timeout'  => 5,
        'port'     => 21,
        'passive'  => true,
        'ssl_mode' => false,
    'debug'    => false
    ), false);
    $ftp->connect();
    var_dump($ftp);
    $ftp->close();

    die('stop');

    Result:

    /data/www/mvhosts/fuel.catwoman.flexcoders.dev/19develop/fuel/app/classes/controller/welcome.php:51:
    object(Fuel\Core\Ftp)[38]
    protected '_hostname' => string '172.16.1.43' (length=11)
    protected '_username' => string 'user' (length=4)
    protected '_password' => string 'pass' (length=4)
    protected '_port' => int 21
    protected '_timeout' => int 5
    protected '_passive' => boolean true
    protected '_debug' => boolean false
    protected '_conn_id' => resource(71, FTP Buffer)
    public '_ssl_mode' => boolean false
    /data/www/mvhosts/fuel.catwoman.flexcoders.dev/19develop/fuel/app/classes/controller/welcome.php:64:
    object(Fuel\Core\Ftp)[39]
    protected '_hostname' => string '172.16.1.43' (length=11)
    protected '_username' => string 'user' (length=4)
    protected '_password' => string 'pass' (length=4)
    protected '_port' => int 21
    protected '_timeout' => int 5
    protected '_passive' => boolean true
    protected '_debug' => boolean false
    protected '_conn_id' => resource(73, FTP Buffer)
    public '_ssl_mode' => boolean false
    stop
  • Sorry for late reply.

    Here is more information.

    My FTP server is not stable and sometimes it fails to connect.

    So, I get error message when I fail to connect to the FTP server.

    Is this helpful?
  • I still would like to have all information displayed on the fuel error page when this happens, because currently it's still guess work to what exactly is causing it.
  • Somehow I can not reproduce the error right now.

    I am very sorry for that.

    I really do not know why I got that error message from oil console.

    Now, what I can give you is log on 28th of Feb, but, this error log is not from oil console, this is from app.

    ERROR - 2018-02-28 15:52:24 --> FTP Error:Connection instance not created        
    ERROR - 2018-02-28 15:52:25 --> FTP Error:Coul not login to the ftp server

    As I said on 3d post, the ftp server,Yahoo triple ftp server, was really unstable like everytime re-connecting 3 to 4 times needed using WinScp.

    Well....If I could reproduce again, I will share it.

    Thanks for your help.

    Best regards,

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion