Ubuntu Agregar permiso a la carpeta
sudo chmod -R 777 /var/DirectoryName
Depressed Dragonfly
sudo chmod -R 777 /var/DirectoryName
sudo chmod 777 /path
chmod -R a+rwx path
To change all the directories to 755 (drwxr-xr-x):
find /opt/lampp/htdocs -type d -exec chmod 755 {} \;
To change all the files to 644 (-rw-r--r--):
find /opt/lampp/htdocs -type f -exec chmod 644 {} \;