If you’re running your web server as user www-data you’ll want to ensure that all the files under your document root are owned by www-data. For example, you can go to your document root (e.g.: /srv/www/htdocs/) and do a change own: chown -R www-data.www-data <yourWebDirectory>
Of course, you’ll have to be superuser to do this or preface the command with a sudo.
This is the most common cause of indigestion I get like you report.