Click to See Complete Forum and Search --> : CHMOD things???


alco19357
11-13-2005, 04:30 PM
hey... this is prbbly one of the noobier questions... but i gotta ask it...

how do you CHMOD something,

such as CHMODing your database text file to 666?


help would be wonderful!!
thanks

bokeh
11-13-2005, 04:34 PM
chmod(); (http://es2.php.net/chmod)

alco19357
11-13-2005, 05:27 PM
would you just put one line of CHMOD? like...

chmod("/somedir/somefile", 0666);

but yet... what do you do with the somedir/somefile? do you even need that?

ty

bokeh
11-13-2005, 05:32 PM
would you just put one line of CHMOD? like...

chmod("/somedir/somefile", 0666);

but yet... what do you do with the somedir/somefile? do you even need that?

tyOf course you need it; how else would would php know which file to chmod.

NogDog
11-13-2005, 05:38 PM
Note that you can only chmod a file that you own. If you created the file with your personal login account, then most likely a PHP script will not be able to chmod it since the webserver normally is configured to run scripts under a unique user ID (typically called 'nobody' in Apache installations). If you created the file via a PHP script, then it should not be a problem.

decibel
11-14-2005, 06:22 PM
is it true this only works with php5+ ?

bokeh
11-15-2005, 04:50 AM
is it true this only works with php5+ ?No!

decibel
11-15-2005, 12:10 PM
what about directories?