using xampp only locally my laravel app suddenly stopped serving and has now become a 403
i cant remember exactly what happened because its been a while and ive been looking through a lot of useless tutorials and posts. I think what happened was i was working on a script to transfer a load of data from one database to another, it was laggy and must have crashed or something and now i get a 403 forbidden when i try to access it
vhosts:
<VirtualHost *:80>
ServerName internal.local
DocumentRoot "D:\projects\internal\public"
<Directory "D:\projects\internal">
Options All
AllowOverride All
Require all granted
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
hosts, im on win 10:
127.0.0.1 internal.local
.htaccess was missing after it happened but i made a new one, theres a htaccess that wasnt deleted in public as well but apparently theres supposed to be one in the root as well
Not sure about having one in the main root directory of Laravel, I do not see one on any install I have. But I think your .htaccess file is wrong in the public directory.
Here is one of mine:
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Send Requests To Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
Might be the server.php, change it to index.php
For some additjonal future knowlege. I used to use XAMPP and had some issues with it as well. I moved over to Laragon, which creates the proper files to access the app via the browser. Plus, it allows me to have multiple versions of PHP and MySQL installed to easily switch back and fourth. If you get a chance, check it out:
@RayC thanks laragon is clearly better for this, tho i cant see a way to run 2 apache versions on different ports at the same time, i have an old php5.5 project that im replacing with laravel so having them running at the same time would be useful