Last active
September 8, 2022 15:23
-
-
Save aamnah/eff1c13f8b8d893c7c61 to your computer and use it in GitHub Desktop.
Opencart Secure Permissions (after install)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # delete install folder | |
| if [ -d "install/" ]; then | |
| rm -rf install | |
| fi | |
| # To change all the directories to 755 (-rwxr-xr-x) | |
| find . -type d -exec chmod 755 {} \; | |
| # To change all the files to 644 (-rw-r--r--): | |
| find . -type f -exec chmod 644 {} \; | |
| # set 444 for admin files | |
| chmod 444 config.php | |
| chmod 444 admin/config.php | |
| chmod 444 index.php | |
| chmod 444 admin/index.php | |
| chmod 444 system/startup.php | |
| # set 777 for cache | |
| chmod 777 image/cache/ | |
| chmod 777 system/cache/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # delete install folder | |
| if [ -d "install/" ]; then | |
| rm -rf install | |
| fi | |
| # To change all the directories to 755 (-rwxr-xr-x) | |
| find . -type d -exec chmod 755 {} \; | |
| # To change all the files to 644 (-rw-r--r--): | |
| find . -type f -exec chmod 644 {} \; | |
| # set 444 for admin files | |
| chmod 444 config.php | |
| chmod 444 admin/config.php | |
| chmod 444 index.php | |
| chmod 444 admin/index.php | |
| chmod 444 system/startup.php | |
| # set 777 for cache | |
| chmod 777 image/cache/ | |
| chmod 777 system/storage/cache/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice script. Thanks for sharing. :-)
I would like to share a library I have coded with the same goal.
Example of usage:
Full documentation: https://github.com/MathiasReker/php-chmod