Mailing List Archive


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

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



> Looks like running an explicit chmod after creating the directory has
> solved the problem:
>
> system("chmod 777 -R $dirPath");

Did you try using php's built-in chmod?
http://php.net/manual/en/function.chmod.php

> Though, I don't see why this should be necessary. If a user has the
> permission to change permissions, shouldn't that user be able to just
> delete the file anyway?

Yes, it is very weird. You never answered my questions. It would be
helpful to know:

1) if this script is being run from a web browser or if it's cli and
2) if it is being run from the web browser what user your web server
(presumably apache) is running as. something like 'ps aux | grep
apache' or 'ps aux | grep httpd' should give you a good indication.

I think some previous responders asked similar questions as well.

Also, it maybe a bit philosophical, but I don't think you've actually
solved your problem. Your script may work now, but it sounds like you
don't really know why. Perhaps the real question here is: "Why does my
script not have write permission to directories it created itself?"
Once you have answered that, the fix should be obvious, and more
importantly you will have learned something very valuable, and... if
you share that, some of us might learn something new too.

Cheers,
Sach


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links