note 19751 added to function.mkdir

From: Date: Sun, 10 Mar 2002 01:17:34 +0000
Subject: note 19751 added to function.mkdir
Groups: php.notes 
Request: Send a blank email to php-notes+get-27564@lists.php.net to get a copy of this message
(Unix only) If you are developing away from the office, remember you can only make a NEW directory using script if you are writing to a directory for which you ( ie 'nobody') has WRITE permissions. If you are developing away from your server, you may think you have write permissions (you were told that the permissions had been set for 'nobody') but you may not have these. Thus before you do anything test to see whetether the directory you are trying to write to has the necessary permissions. I find the following useful. <?php $dirtotest="[directory name]"; //$bool= chmod($dirtotest,0775); //echo $bool; if(is_dir($dirtotest)) {echo "<br />".$dirtotest." is a directory<br />";} else {echo "Is NOT a directory<br />";} if(is_readable($dirtotest)) {echo $dirtotest." is readable<br />";} else {echo $dirtotest." is NOT readable<br />";} if(is_writable($dirtotest)) {echo $dirtotest." is writable<br />";} else {echo $dirtotest." is NOT writable<br />";} if(is_executable($dirtotest)) {echo $dirtotest." is executable<br />";} else {echo $dirtotest." is NOT executable<br />";} ?> -- http://www.php.net/manual/en/function.mkdir.php http://master.php.net/manage/user-notes.php?action=edit+19751 http://master.php.net/manage/user-notes.php?action=delete+19751 http://master.php.net/manage/user-notes.php?action=reject+19751

« previous php.notes (#27564) next »