winzurf
New member
I'm trying to use my website to replace files on my account using PHP and FTP - I can log in ok but get these error messages when I try to upload a file:
[27-Nov-2022 23:31:39 UTC] PHP Warning: ftp_put(): php_connect_nonb() failed: Operation now in progress (115) in /home/eastbourne/public_html/tts/gtts.php on line 51
[27-Nov-2022 23:31:39 UTC] PHP Warning: ftp_put(): Type set to I. in /home/eastbourne/public_html/tts/gtts.php on line 51
I've tried various changes suggested online, none are helping, so I'm hoping someone may have code that's working?
code sample -----------------
$host= 'c17.radioboss.fm';
$user = '#####';
$password = '#####';
$ftpConn = ftp_connect($host,21,500);
$login = ftp_login($ftpConn,$user,$password);
// check connection
if ((!$ftpConn) || (!$login)) {
echo 'FTP connection has failed! Attempted to connect to '. $host. ' for user '.$user.'.<br>';
} else{
echo 'FTP connection was a success.<br>';
ftp_set_option($ftpConn, FTP_USEPASVADDRESS, false);
ftp_pasv($ftpConn, true);
$file="horse.mp3";
if (ftp_put($ftpConn, $file,$file, FTP_BINARY)) {
echo "successfully uploaded ".$file."<br><br>";
} else {
echo "There was a problem while uploading ". $file."<br><br>";
}
[27-Nov-2022 23:31:39 UTC] PHP Warning: ftp_put(): php_connect_nonb() failed: Operation now in progress (115) in /home/eastbourne/public_html/tts/gtts.php on line 51
[27-Nov-2022 23:31:39 UTC] PHP Warning: ftp_put(): Type set to I. in /home/eastbourne/public_html/tts/gtts.php on line 51
I've tried various changes suggested online, none are helping, so I'm hoping someone may have code that's working?
code sample -----------------
$host= 'c17.radioboss.fm';
$user = '#####';
$password = '#####';
$ftpConn = ftp_connect($host,21,500);
$login = ftp_login($ftpConn,$user,$password);
// check connection
if ((!$ftpConn) || (!$login)) {
echo 'FTP connection has failed! Attempted to connect to '. $host. ' for user '.$user.'.<br>';
} else{
echo 'FTP connection was a success.<br>';
ftp_set_option($ftpConn, FTP_USEPASVADDRESS, false);
ftp_pasv($ftpConn, true);
$file="horse.mp3";
if (ftp_put($ftpConn, $file,$file, FTP_BINARY)) {
echo "successfully uploaded ".$file."<br><br>";
} else {
echo "There was a problem while uploading ". $file."<br><br>";
}