Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
General
[Bug report]FTP core class
soseki
February 2018
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?
Harro
February 2018
Any more details?
What Fuel version? What line triggers this message? What is the error exactly, is it a PHP error, an Exception?
soseki
February 2018
Fuel version is 1.8.
ubuntu16.04
PHP 7.0.22
It looks like the error comes from line 171.
Harro
March 2018
The Fuel error page should display the exact filename and line number, and a backtrace?
Harro
March 2018
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
soseki
March 2018
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?
Harro
March 2018
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.
soseki
March 2018
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,
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,089
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
261
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
Harro
March 2018
soseki
March 2018