How do I check if a directory is writeable in PHP?

前端 未结 10 1671
别跟我提以往
别跟我提以往 2021-01-01 08:07

Does anyone know how I can check to see if a directory is writeable in PHP?

The function is_writable doesn\'t work for folders.

Edit: It doe

10条回答
  •  抹茶落季
    2021-01-01 09:01

    I've written a little script (I call it isWritable.php) that detects all directories in the same directory the script is in and writes to the page whether each directory is writable or not. Hope this helps.

    ';
        } else {
            echo $dir.' is not writable. Permissions may have to be adjusted.
    '; } } ?>

提交回复
热议问题