Page 1 of 1

CHMOD Questions

Posted: Sun Aug 06, 2006 5:56 am
by supercabbage
Hello, i recently bought some hosting and it's not the best. I can't CHMOD using FTP Software as i get the following error whenever i try to CHMOD anything.
500 'SITE CHMOD 666 db.txt': command not understood
I was talking to my host who said they are "working on it" but in the mean time i should use PHP to get the job done. Well it's been a few weeks since he said he was working on it so i guess it's not happening any time soon.

I was reading on PHP.net about the CHMOD function which i tried, the chmod.php file i made didn't show up any errors (blank white page) but the files do not seem to have the correcrt CHMOD value. Basicaly how can i ensure that the files are actually being CHMODed. Also is the following code the "right" code for the job?

Code: Select all

<?php
chmod("tagbox/db.txt", 0666);
chmod("tagbox/online.txt", 0666);
?>
Is there any other way to do this without using PHP? I personaly think it's ridiculous that i'm paying for a service where i can't even CHMOD using bog-standard FTP software. Oh, and by the way the file (CHMOD.php) is in the same directory as index.php and links to two files in a tagbox directory.

I'm a newbie when it comes to PHP so if you could break it down into simple terms that would be great :wink:. Any help would be much appreciated.

Posted: Sun Aug 06, 2006 6:41 am
by s.dot
Hmm, that PHP code looks good to me. Try this to see if they are actually being chmod()'d.

Code: Select all

if(chmod('somefile.txt', 0666))
   echo 'Yay, it works!';
else
   echo 'Boo, no worky. ';

Posted: Sun Aug 06, 2006 2:47 pm
by supercabbage
Many thanks. I was able to verify whether or not the CHMOD commands were working and put the problem down to the script, not the chmod value. Thank you!