Im trying to set a directories permissions to 777 at runtime to upload a picture and then set it back to 755 once the upload script is done but im getting warning
Warning: chmod(): Operation not permitted in
directory_path on line
3
The code to chage the permissions is
- PHP: Select all
<?php
$uploaddirectory = "directory_path";
chmod($uploaddirectory, 777);
?>
Does this mean my hosts won't allow me to change the permissions, is there a way around this (im not really wanting to leave the directory at 777 permanently.
Also what are the security risks of this (being on a shared server), is there anything I can do to minimise the risks?