This question already has an answer here:
Having trouble deleting a directory/folder via ftp php script..
I am getting a weird warning in my php log, and the ftp_delete function is not working. Please see below
PHP LOG says:
PHP Warning: ftp_delete(): End in C:\Hosting\HYPV\website.com\wwwroot\Services\TestDelete.php on line 29
<?php
require('../FTPconfig.php');
$conn_id = ftp_connect($ftp_server);
$login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass);
ftp_pasv($conn_id,true);
$contents = ftp_nlist($conn_id, "/FTP/website.com/wwwroot/Clients/clientName/Reports/");
if ($contents == true) {
foreach ($contents as $file) {
$local_file = $file;
$server_file = '/FTP/website.com/wwwroot/Clients/clientName/Reports/'.$file;
ftp_delete($conn_id, $server_file); //<------------------- PHP LOG says: ftp_delete(): End in C:\Hosting\HYPV\website.com\wwwroot\Services\TestDelete.php on line 29
}
} else {
echo "No files available.";
}
ftp_close($conn_id);
?>
</div>