I was running localhost (Apache 2.4.6) but only the index.php
was openable in the web browser. The subdirectories were returning 403 Forbidden error.
Now, I added the permissions according to this answer. For reference, these were the permissions:
sudo adduser <username> www-data
sudo chown -R www-data:www-data /var/www
sudo chmod -R g+rw /var/www
Accordingly, the folder in which I placed all the content of the website became owned by www-data
group. And although I've added myself to the group, I cannot open the folder!
(But the subdirectories have become accessible from the web browser.)