How to put files in SFTP using PHP yii2
one text
Solution:
In the example they put
$gftp->put($tmp_file,$filename,"FTP_ASCII", true)
but it should be:
$gftp->put($tmp_file,$filename,FTP_ASCII, true)
that will get rid of your current error message
Source