tags:

views:

25

answers:

1

How to check permissions of directory in PHP

$filename = 'dev\permis';
$handle = fopen($filename.'\file.txt', "w");
if (is_writable($filename)) 
{
    echo 'The directory is writeable';
} 
else
{
    echo 'The directory is not writable';
}
  1. when i set permisson for permis folder is write ,

    the file.txt is created and browser " The directory is writeable"

  2. when i set permisson for permis folder is deny write ,

    the file.txt is not created and browser is still " The directory is write" , why not "The directory is not writeable"

How to check permission of folder permisson ?

A: 

Did you call clearstatcache between runs of this script?

Borealid
i added clearstatcache function , but nothing changed.I run it on localhost.what diffirent betwwen run it on localhost and host ?
Chameron