How to change permission of Folder(and it’s files) to 755 to prevent deletion of file from outside virus? And how to return to 777?
Want to use 777 only when necessary inside of php code.
Assuming file 333.jpg location in “image” Folder,
bellow should “not” delete file, 333.jpg?
<?php
chmod("./image/" , 0755);
unlink("./image/333.jpg");
?>
For return to normal, bellow should delete file?
<?php
chmod("./image/" , 0777);
unlink("./image/333.jpg");
?>
BUT ABOVE CODES IS NOT WORKING..
Am running php under linux.
Thnaks in advance.
When i change permission through terminal by
“sudo chmod 755 /var/www/html/image”
it works. But not through php,,,,