Welcome Guest, Not a member yet? Register   Sign In
mkdir problems
#5

[eluser]jedd[/eluser]
[quote author="Guntars" date="1245713356"]I know abourt that, but why when creates directory, it's change permisions from 777 to 755. I have debian linux.[/quote]

Good man (or woman). Up until this point I was disinclined to help, since google would answer this faster than I could hit reply ....

Quote:Somewhere seems umask. But where, usualy I can change umask in apache PHP?

You need to play with the umask command, specifically modifying the /etc/apache2/envvars file. Probably something like:
Code:
umask 000
.. assuming you want 777 at the other end.

Of course, you probably do not want 777 permissions on your files, as this is relatively (read hugely) insecure.

With Debian, apache runs as uid: www-data and gid: www-data

Caveat here - this is out of the box, but you can configure your apache to run scripts as a given user, and some hosting sites (my system at Uni for example) do this. The best way to check is to exec("touch /tmp/bob") or similar and then investigate that file.

Now, if you can't change the perms from within apache/php on a file that you just created, then that is quite odd. You (apache) may need to own the parent directory of that file, and/or change permissions of same.

Given the nature of the questions you're asking, my suspicion is that you're doing (or are about to do) something quite dangerous. You may want to elucidate on what you're trying to create, and where in the file system - as there are probably cleaner ways of doing this.


Messages In This Thread
mkdir problems - by El Forum - 06-21-2009, 05:14 PM
mkdir problems - by El Forum - 06-22-2009, 01:32 AM
mkdir problems - by El Forum - 06-22-2009, 01:46 AM
mkdir problems - by El Forum - 06-22-2009, 12:29 PM
mkdir problems - by El Forum - 06-22-2009, 12:38 PM
mkdir problems - by El Forum - 06-22-2009, 01:25 PM
mkdir problems - by El Forum - 06-22-2009, 01:41 PM
mkdir problems - by El Forum - 06-22-2009, 02:04 PM
mkdir problems - by El Forum - 06-22-2009, 02:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB