newbie Q - file deletions and permissions problem
Posted: Sat Jun 26, 2004 2:12 pm
im trying to delete a text file. Nothing fancy.
No matter what I do, the script always returns permission denied. Chmod set to 777 via ftp.
ive read thru the past posts, and tried stuff ive come accross, but it still wont do it
Ive tried:
Whats even stranger, is that the chmod command itself is blocked by the server (operation not permitted)
What am i doing wrong? Do i need to get my host to change the setup?
other than doing a chown, i dont know what else to try
No matter what I do, the script always returns permission denied. Chmod set to 777 via ftp.
ive read thru the past posts, and tried stuff ive come accross, but it still wont do it
Ive tried:
Code: Select all
<?php
// now delete counter file
$filename = $_SERVER["DOCUMENT_ROOT"] . '/test.txt';
if (file_exists($filename))
{
chmod($filename, 0777);
unlink($filename);
echo 'deleted... apparently';
}
-------------
// now delete counter file
$filename = $_SERVER["DOCUMENT_ROOT"] . '/test.txt';
if (file_exists($filename))
{
unlink($filename);
echo 'deleted... apparently';
}
------------
// now delete counter file
$filename = './test.txt';
if (file_exists($filename))
{
unlink($filename);
echo 'deleted... apparently';
}
?>What am i doing wrong? Do i need to get my host to change the setup?
other than doing a chown, i dont know what else to try