You need to change the directory permission so that web server process can change the directory.
-
To change ownership of the directory, use
chown:chown -R user-id:group-id /path/to/the/directory -
To see which user own the web server process (change
httpdaccordingly):ps aux | grep httpd | grep -v grepOR
ps -efl | grep httpd | grep -v grep