Skip to content

Instantly share code, notes, and snippets.

@BionicClick
Created October 1, 2014 00:12
Show Gist options
  • Save BionicClick/0a0c3d99c16f5268732c to your computer and use it in GitHub Desktop.
Save BionicClick/0a0c3d99c16f5268732c to your computer and use it in GitHub Desktop.

Fixing File and Folder Permission on suPHP

After installing suPHP on server, execute:

###This command fix all folder permission

  • find /home/*/public_html -type d -exec chmod 755 {} ;

This command fix all file permission

  • find /home//public_html -name '.php' -o -name '.php[345]' -o -name '.phtml'| xargs chmod -v 644

This script fix all ownership issue

  • #!/bin/bash
  • cd /var/cpanel/users
  • for user in *
  • do
  • chown -R $user.$user /home/$user/public_html/*

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment