Closed Thread Icon

Topic awaiting preservation: PHP CHMOD (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=12826" title="Pages that link to Topic awaiting preservation: PHP CHMOD (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: PHP CHMOD <span class="small">(Page 1 of 1)</span>\

 
Lurch
Paranoid (IV) Inmate

From: Behind the Wheel
Insane since: Jan 2002

posted posted 07-22-2003 07:28

I'm making a flat-file blog like site without mysql..
usually (on other servers) I can just chmod the dir that contains the files I want to be able to write to, and its good. However on this server (my local ISP) it seems to be reseting the permissions! I'm not sure *when* or *why* yet.. this is really weird. I should be able to get by by just using chmod() in my script, but I shouldn't have to - I should be able to set the permissions via ftp and leave it. Anyone know what it may be? a server setting i can get my isp to change?? is it my user permissions on the server?

thanks

[edit]spelling [/edit]



[This message has been edited by Lurch (edited 07-22-2003).]

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 07-22-2003 10:21

well, I know that it's usual practices for a good server admin to have two scripts,
one that makes sure that the files in the ftp directories actually belong to a ftp user,
and b) that there are no files that are 666 or even > 661 in those directories.

what are you trying to set the permission to?

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 07-22-2003 13:49

Lurch: Are you sure the CHMOD has worked? Post us the code you are using.

Also if you set it via FTP does that stick?

Also have a look at the manual:
www.php.net/chmod

As I know I had CHMOD problems that were solved by that.

___________________
Emps

FAQs: Emperor

Lurch
Paranoid (IV) Inmate

From: Behind the Wheel
Insane since: Jan 2002

posted posted 07-23-2003 09:12

Thanks for the replies..

The CHMOD's were working.. i suspect its that they're either not "sticking".. my server admin isn't one I'd call "good" really.. he calls ME with PHP questions etc.. he just finally installed PHP on the local isp server because I was nagging him for the last year.. now he's asking me questions about installing mysql

I know how to use chmod() in php, but I did learn a bit more about chmod etc.. through my research and your messages guys.. thanks

It turned out I was just up a little late and was going about it wrong.. mixed up my functions.. was trying to use dir() or something... I straightened it out today using the functions i meant to be using - opendir() then readdir() and finally is_dir()..

maybe i should up the caffeine and keep my php dictionary a little handier for reference

anyway I whipped it up once i realized where I goofed.. here's a function I put together.. haven't given it a really good look over yet but I'll throw it up here anyhoo. tear it up and tell me how much better it could be... i know it could be more universally useful, but for my little project its just what I need

code:
function dirt($path, $dirt_df = 0){
if($dir = opendir($path)){
$d = 0; $f = 0;
while(false !== ($file = readdir($dir))){
if(is_dir($path."/".$file)){
$dirt_directories[$d] = $file;
$d++;
}else{
$dirt_files[$f] = $file;
$f++;
}

}
closedir($dir);
if($dirt_df == 0){
return $dirt_directories;
}else{
return $dirt_files;
}
}

}



as you can see it should return an array of EITHER the directories OR files in a path.. I haven't tested it out really but its time for bed

[edit]ooops... left some sloppy "test" code in there.. not there now[/edit]



[This message has been edited by Lurch (edited 07-23-2003).]

[This message has been edited by Lurch (edited 07-23-2003).]

Lurch
Paranoid (IV) Inmate

From: Behind the Wheel
Insane since: Jan 2002

posted posted 07-23-2003 09:16

... oh, and chmod obviously isn't an issue here

chalk another one up for a lack of caffeine - well thats my excuse at least.. and i'm sticking to it


« BackwardsOnwards »

Show Forum Drop Down Menu