Bug #68854 [Com]: Cannot FTP_Put over SSL

From: Date: Wed, 21 Jan 2015 23:36:51 +0000
Subject: Bug #68854 [Com]: Cannot FTP_Put over SSL
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190122@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68854&edit=1 ID: 68854 Comment by: cmbecker69 at gmx dot de Reported by: ian dot gooch at weatherquest dot co dot uk Summary: Cannot FTP_Put over SSL Status: Open Type: Bug Package: FTP related Operating System: linux PHP Version: 5.5.20 Block user comment: N Private report: N New Comment: Have you considered asking in a support forum or mailing list, such as php-general@lists.php.net before filing a bug report? Anyhow, the following statement looks suspicious: ftp_set_option($FTPCon, FTP_TIMEOUT_SEC, 10); Previous Comments: ------------------------------------------------------------------------ [2015-01-19 07:46:25] ian dot gooch at weatherquest dot co dot uk Description: ------------ I've tried and tried to ftp_put over a secured connection. Errors returned are ftp_put(): Opening BINARY mode data connection. Type set to I I've tried to things like ftp_pasv, but no joy. I know the connection work because Dreamweaver connects are uploads fine. Thanks, Test script: --------------- //FTP FILE $FTPServer="******"; $Port=21; $User="******"; $Pass="******"; echo "$FTPServer | $Port | $User | $Pass <br>"; //=================================================== $DEST="******"; $NAME="SomeFile.csv"; $DESP="$DEST$NAME"; //====================================================== //SET UP CONNECTION $FTPCon = ftp_ssl_connect($FTPServer,$Port) or die("Cannot connect to server!"); $LOGINR = ftp_login($FTPCon,$User,$Pass) or die("Cannot login!"); //ftp_pasv($FTPCon,true); ftp_set_option($FTPCon, FTP_TIMEOUT_SEC, 10); //-------------------------------------------------------------------- //CHECK CONNECTION if ((!$FTPCon) || (!$LOGINR)) { echo "FTP connection has failed!"; exit; }else{ echo "Connected to $FTPServer,$Port, for user $User <br/>"; //CHANGE DIR echo "Current directory: " . ftp_pwd($FTPCon) . "\n"; echo "<br>"; //==================================================== if (ftp_chdir($FTPCon, "*******")) { echo "Current directory is now: " . ftp_pwd($FTPCon) . "<br>"; }else{ echo "Couldn't change directory <br>"; echo "<br>"; //================================================== } //UPLOAD FILE $UPLoad = ftp_put($FTPCon,$NAME,$csvOut,FTP_BINARY); if (!$UPLoad) { echo "FTP upload of $NAME has failed! <br/>"; }else{ echo "Uploading $name Completed"; } } ftp_close($FTPCon); echo "Bye Bye you"; //--------------------------------------------------------------------- Expected result: ---------------- The file uploads (ftp) to a secured server ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68854&edit=1

« previous php.bugs (#190122) next »