Add this in some php file and call it via browser.
if (chmod('/path/dir', 0777)) echo 'Done'; else echo 'Error';