title: Deleting files using PHP's ftp_delete function not working
body: <p>I'm trying to delete files off my ftp server using php's ftp_delete function, however i can not seem to get it to work.</p>
  
  <p>I have followed the instructions on the php man page <a href="http://uk3.php.net/function.ftp-delete" rel="nofollow">ftp_delete</a> but still have had no luck.</p>
  
  <p>Maybe i have missed something? </p>
  
  <p>When using the file on my local testing server it would appear it connects fine, however when i upload the file to the remote server, i cannot connect at all.</p>
  
  <p><strong>My Code</strong></p>
  
  <pre><code>&lt;?php
  
  // server credentials
  $ftp_server = "address.myftpupload.com";
  $ftp_username = "Password";
  $ftp_userpass = "UserName";
  
  // set up basic connection
  $conn_id = ftp_connect($ftp_server) or die("Could not connect to $ftp_server");
  
  // login with username and password
  ftp_login($conn_id, $ftp_username, $ftp_userpass);
  
  ftp_pasv($conn_id, true);
  
  //change dir
  ftp_chdir($conn_id, "webroot/CundyTech/BassClef/gallery-images/images");
  
  // try to delete $file
  $file = "webroot/CundyTech/BassClef/gallery-images/images/metal_textures_silver.jpg";
  if (ftp_delete($conn_id, $file)) {
  echo "$file deleted successful\n";
  } else {
  echo "could not delete $file\n";
  }
  
  // close the connection
  ftp_close($conn_id);
  
  
  ?&gt;
  </code></pre>
  
  <p>Any help would be great, or even just a point in the right direction.</p>