I want to create a more realistic dev environment for my laravel app. I want to start my laravel app with apache.
The issue is, I always get this error if I try to access the project through the URL (localhost.eu):
Forbidden
You don't have permission to access / on this server.
What I have done so far:
- Edited the
httpd.conf
inApache\conf
, I uncommented this line:
LoadModule rewrite_module modules/mod_rewrite.so
- Edited the
httpd-vhosts.conf
inApache\conf\extra
, I added:
<VirtualHost *:80>
DocumentRoot "Y:/PHP-Projects"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "Y:/PHP-Projects/Project-Admin-PHP/public"
ServerName localhost.eu
<Directory Y:/PHP-Projects/Project-Admin-PHP/public>
AllowOverride all
Require all granted
</Directory>
</VirtualHost>
- Edited the
hosts
file inWindows\System32\drivers\etc
, I added:
127.0.0.1 www.localhost.eu localhost.eu
I also tried to edit the default laravel
.htaccess
, basically I tried all solutions in this thread.Edited the
httpd.conf
inApache\conf
:
<Directory Y:/PHP-Projects/Project-Admin-PHP/public>
AllowOverride all
Require all granted
</Directory>
It was:
<Directory />
AllowOverride none
Require all denied
</Directory>
After every step I restarted the apache24 service.
NOTE: If I try to access, f.e. localhost.eu/robots.txt
I see the file, so it correctly connected to the project folder.
If I type in http://localhost.eu/index.php
I see the code of the index.php, it is somehow not executed?