How to use chmod() function to change file mode in PHP

4 Answers

0 votes
// Read and write for owner only
chmod("c:/xampp/htdocs/knowrex.com/test-file.php", 0600); 
   
/*
run:

 
*/

 



answered Apr 17, 2016 by avibootz
0 votes
// Write for owner only, Read for all
chmod("c:/xampp/htdocs/knowrex.com/test-file.php", 0644); 
 
/*
run:

 
*/

 



answered Apr 17, 2016 by avibootz
0 votes
// All for owner, read and execute for all
chmod("c:/xampp/htdocs/knowrex.com/test-file.php", 0755); 
 
/*
run:

 
*/

 



answered Apr 17, 2016 by avibootz
0 votes
// All for owner, read and execute for owners group
chmod("c:/xampp/htdocs/knowrex.com/test-file.php", 0750); 

/*
run:

 
*/

 



answered Apr 17, 2016 by avibootz
...