Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Arrrg! Permissions driving me nuts in PHP



On 11/23/2010 05:44 AM, Dave M G wrote:
TLUG,

In a PHP script I have, I use mkdir() to create a directory and put some
files in it.

It's just a temporary directory to organize some files that I bundle
into a tar.gz file and store away.

After I've got the tar file made, I want to delete the temp directory. I
use the code included at the bottom (which I took from the PHP manual
site) to recursively delete the directory and its subdirectories and files.

However, when I run the code, I get permission errors:
Warning: unlink(/home/site/public_html/+backup/someFileOrOther)
[function.unlink]: Permission denied in
/home/site/public_html/backup.php on line 115

How can a directory I just made a few lines earlier in a PHP script have
permissions that don't permit the very same script that created it to
delete it a few lines later?

More importantly, how do I remove the $%&#ing thing?

Did you check SELinux logs? I have had quite a few "weird" problems that I could trace back to SELinux.

/Fredric
begin:vcard
fn:Fredric Fredricson
n:Fredricson;Fredric
org:Ln4 Solutions AB
email;internet:Fredric.Fredricson@example.com
title:CTO
tel;home:+46 8 91 64 39
tel;cell:+46 70 677 58 48
version:2.1
end:vcard


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links