Permissions Script Not Working

For anyone scratching the heads with the same problem. After, I removed the mod_security and evasive module from my local lamp development server, which was a bit overkill, I discovered that the above script worked perfectly. So if you are using WP and getting a 403 error that you can’t figure out, also disable mod_security and/or evasive module as they might be causing your 403 error as well.