Hi i have a script which dynamically created a file on my local directory Please tell me how can i give 777 permission to that file right now it is unaccessible in the browser Show
asked Jan 7, 2013 at 9:30
Rohit GoelRohit Goel 3,3147 gold badges51 silver badges104 bronze badges 3 Use the function chmod
answered Jan 7, 2013 at 9:32
1 Use answered Jan 7, 2013 at 9:31
use:
answered Dec 5, 2014 at 10:32
Give permission in to dynamically created file
answered Nov 19, 2015 at 9:40
You can use chmod() to do this. e.g. answered Jan 7, 2013 at 9:32
Thomas ClaysonThomas Clayson 29.3k26 gold badges144 silver badges223 bronze badges set
then any thing u create in that directory it takes
Dhara 4,0932 gold badges34 silver badges69 bronze badges answered Jan 7, 2013 at 11:06
we can even ignore *$handle* it will still create the file and copy the content to the $path
answered Jan 9, 2013 at 10:10
Rohit GoelRohit Goel 3,3147 gold badges51 silver badges104 bronze badges How do I give PHP permission to 777?If the operation is for already created file then:. PHP Syntax. chmod ( string $filename , int $mode );. Ex: chmod('text.txt', 0777);. If you are creating a new file dynamically then:. PHP Syntax. ... . Ex: mkdir($_SERVER['DOCUMENT_ROOT']. ... . Hope its clear.. How do I give permission to a folder in PHP?You can use chmod() function.
What permissions should php files have?Set php files to 640. For maximum security you should set minimum permissions, which is 640. The owner 6 would be the one uploading the files.
What is the use of chmod 777?The command chmod -R 777 / makes every single file on the system under / (root) have rwxrwxrwx permissions. This is equivalent to allowing ALL users read/write/execute permissions.
|