chmod 777chmod 777 is considered potentially dangerous because you are giving read, write and execute permission on a filedirectory to everyone.chmod(string $filename , int $permissions ): bool Attempts to change the mode of the specified file to that given in permissions.