To fix this annoying issue on your website:

  1. Download attached script which will automatically set permissions of all directories to 755, and all files to 644.
  2. If you need, you can edit the script to change the permissions to any other value.
  3. Unzip it and upload the PHP file to the root folder of your website.
  4. Go to yourdomain.com/php-per.php
  5. After a moment, a list of files and directories will appear, which means the script has set the permissions successfully.