You need to insure that the php process (web server) is a member of the group for the Drupal files. You should make sure that the owner of the files is some user other than the php process / web server, because you do not want to allow the web server to overwrite the Drupal code files.
To change the group of all of the files in your root:
sudo chgrp -R webgroup /path/to/drupal
To add a group to the web server user:
sudo usermod -a -G webgroup www-data
For more advice on correctly setting file permissions for Drupal, see Securing File Permissions and Ownership.