What permissions do I need to give for my server setup?
Apache is the process that needs to have appropriate permissions to access /var/www.  Apache is typically user _www of group _www on MacOS.  Verify this with:

 grep -e '^Group\|^User' /etc/apache2/httpd.conf


Two lines should be printed.  My output looks like:

User _www
Group _www


This means that on my system, Apache processes run as user _www with group _www. If you're using another configuration, check the appropriate config file for the same parameters and replace _www in the following solution if yours differs.


Change the group of /var/www with: chgrp -R _www /var/www
Change the permissions to add group write with: chmod -R 775 /var/www


That should fix the error. 

As an extra step, you can change the ownership of /var/www to _www and then add yourself to that group to maintain your read and write privileges.