Jump to content

Unlink file


retoto

Recommended Posts

Okay..

you may need to change the access right of the public_html, do you know what they are set to ?

or the server may have some restrictions..

 

i guess you could try via FTP....

<?php
$file = "test.txt";
$ftpUserName = 'username';
$ftpUserPass = 'userpass';
$ftpServer = 'ftp.example.com';

  $ftpConn = ftp_connect($ftpServer);

  if (!$ftpConn) {
    die("Unable to connect to $ftpServer");
  }

if (@ftp_login($conn_id, $ftpUserName, $ftpUserPass)) {
   echo "Connected as $ftpUserName @ $ftpServer";
}
else {
   echo "Couldn't connect as $ftpUserName";
   ftp_close($ftpConn);
   die("Closed connection to $ftpServer");
}

echo ftp_chmod($ftpConn, 0777, $file) ? "CHMOD successful!" : 'Error';

// try to delete $file
if (ftp_delete($ftpConn, $file)) {
echo "$file deleted successful\n";
} else {
echo "could not delete $file\n";
}

// Close the connection
ftp_close($conn_id);
?>

Link to comment
https://forums.phpfreaks.com/topic/73192-unlink-file/#findComment-369218
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.