I downloaded the latest Magento 2 version from the Magento download site.
Then, extracted it on my Apache Webserver root directory.
I renamed the extracted Magento directory as magento2
.
I installed Magento2 via command line.
Now, when I browse http://127.0.0.1/magento2
, I get the following error:
Forbidden
You don’t have permission to access /magento2/ on this server.
Server unable to read htaccess file, denying access to be safe
I checked the file permission and file ownership of all the files and folders inside the magento2 directory and everything seems to be fine.
Then, I checked the Apache error log which was present in the file: /var/log/apache2/error_log
tail -100 /var/log/apache2/error_log
In that file, I found the following error message:
Permission denied: [client 127.0.0.1:61213] AH00529: /Users/mukeshchapagain/Sites/magento2/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that ‘/Users/mukeshchapagain/Sites/magento2/’ is executable
So, finally found the exact cause of the Forbidden error.
Actually, the magento2
folder itself had the wrong permission.
I set the 755 permission to the magento2
folder and now I am able to browse http://127.0.0.1/magento2
successfully.
sudo chmod 755 /path/to/your/magento2
Hope this helps. Thanks.