hot to set default file permission / owner / group |
[eluser]vile[/eluser]
can anyone tell me how to set the default permission/ owner and group, whenever i create new file using a script. thanks example: Quote:mkdir('test/dirc/')
[eluser]mironcho[/eluser]
Hi vile, you can set default permissions with umask (but you have to set it every time when your application runs and before uploading something) or change permission/group of some file later with chmod and chown (using chown is not always possible/allowed). In addition, you can set file permissions while creating directory with mkdir by setting it's second argument: Code: mkdir(’test/dirc/’, 0775);
[eluser]vile[/eluser]
thanks for you reply. yes i tried to set umask now my problem is the owner and group of the file. chown / chgrp is not working. however i tried to change httpd.conf user and group. i set it to apache and dev. it worked but still got problem. i cant use phpmyadmin... is there away other way to fix this? thanks
[eluser]Michael Wales[/eluser]
It sounds like your host has a limitation on what scripts can accomplish with regards to the filesystem.
[eluser]vile[/eluser]
this is the error message Quote:SAFE MODE Restriction in effect. The script whose uid is 48 is not allowed to access /home/chat/codeigniter/chat/agents/rex/client_xml/ owned by uid 99 uid 48 is apache uid 99 is nobody I set php.ini safe mode = off. it didnt work i also tried to disable safe mode in htaccess. still no luck. is it normal to run apache under nobody and user id set to #-1? if not, who should run apache and under what group? |
Welcome Guest, Not a member yet? Register Sign In |