chmod 777To apply chmod 777 to all the files and subfolders within the folder, you can use the find command in combination with the chmod command.chmod(string $filename , int $permissions ): bool Attempts to change the mode of the specified file to that given in permissions.