Modify the permission of a file/directory – PHP

<?php

chmod("/your_dir/your_file", 0600);
// Read and write for owner, nothing for everybody else

chmod("/your_dir/your_file", 0644);
// Read and write for owner, read for everybody else

chmod("/your_dir/your_file", 0755);
// Everything for owner, read and execute for others

chmod("/your_dir/your_file", 0750);
// Everything for owner, read and execute for owner's group

?>

Leave a Reply

Your email address will not be published. Required fields are marked *