When configuring a web server for the first time, balancing file permissions between locally created, FTP uploaded and PHP created files can be difficult until everything is configured correctly. The following script can help correct any issues and reset all files to a standard.
Be sure to change
GROUP_USER to your appropriate settings.
TARGET_PATH can also be modified when calling the script by including the path required as the
first parameter (Eg.
The permissions set in the script (640) are as follows:
Owner: Read & Write
Group: Read Only
Owner and Group are also allowed to
Execute (i.e. browse) directories (750).