PHP Script to set permissions of all folders for SuiteCRM 8

There are many posts that refer to a php script to correct the file permissions recursively, but none of those posts offer a link to the script file. Some posts are as old as 2014.

Is there a php script for SuitCRM 8, that can be called and will set all file permissions and ownership in one go correctly?

The only reason I need to do this is I see ‘undefined’ in some pop up windows.