In general cache folder needs 777 permission and rest are 755 for folders and 644 for files. Following is PHP script which will do that. It solved many permission related issues.
Following PHP script will update all folder permission to 755 and all files with 644 permission.
What are File Permissions?
There are three types of permissions:
You can view your file permissions in your cPanel File Manager or FTP Client. They will display not with the letters, but with numbers. The numbers used are:
7 = read, write, execute
6 = read, write
5 = read, execute
4 = read only
3 = write, execute
2 = write only
1 = execute only
0 = Access Denied
The File Permissions will show as three numbers. The numbers always go in the same order: