Jump to content

Trouble With is_writable


TheMayhem

Recommended Posts

I am working on a debug script to see if users had setup my script correctly. The very last part I have is a little debug section where it checks for some common errors. I am having problems with one last part, which is checking to see if they correctly setup the chmod permissions to 0777. This is my coding below:

 

// Directory Permissions
$path = $_SERVER['DOCUMENT_ROOT'];
$customavatar = $path."/customavatars";
$smilies = $path."/images/smilies";
$store = $path."/images/pointmarket/store";
$text4 =  $vbphrase['market_maintenance_directory_good'];
    $icon4 = "$site_url/checkmark.png";
if (!is_writable(dirname($customavatar))) {
$badfolder = $customavatar;      
$text4 =  $vbphrase['market_maintenance_directory_bad'];
    $icon4 = "$site_url/warning.gif";
}
if (!is_writable(dirname($smilies))) {
$badfolder = $smilies;      
$text4 =  $vbphrase['market_maintenance_directory_bad'];
    $icon4 = "$site_url/warning.gif";
}
if (!is_writable(dirname($store))) {
$badfolder = $store;      
$text4 =  $vbphrase['market_maintenance_directory_bad'];
    $icon4 = "$site_url/warning.gif";
}

 

 

Now I've physically tested it to see if I have all directories chmodded to 0777 and they all are. However, whenever I output each time I am being shown that the directories are showing me that they aren't writeable because $badfolder, $text4, and $icon4 are all being reassigned within the if statement. I've tried each one of the three above to see and all of them are going within the if statement even though they shouldn't be.

 

Can anyone tell me what I might be doing wrong?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.