Reputation: 822
I am running laravel on xampp and I have problem with accessing pages,
http://localhost/laravel/public/
I get a login page which is good
however when I go for example http://localhost/laravel/public/smokeyard
I get 404
error with The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
Route:
Route::get('smokeyard', 'GuzzleController@smokeyard');
Controller:
function smokeyard(){
return view('smokeyard');
}
All my views are located in resources folder.
Upvotes: 2
Views: 7385
Reputation: 1
I tried this in MX Linux 21.xx. My xampp got messed up after installing larvel on it.
mysql service status
service mysql stop
you will be prompted to provide your password, Enter password.
start xampp using command
sudo /opt/lampp/lampp start
Upvotes: 0
Reputation: 27513
if you want to access laravel project without running artisan serve
, you need to change few settings,
copy the .htaccess
file from the public folder
and paste
it in the root folder
of your application
rename
the server.php
in the root directory to index.php
now go to localhost/your_project_name/smokeyard
for the url you want to check
hope this helps
Upvotes: 5
Reputation: 11906
Run php artisan serve
and access your server at http://localhost:8000
. Your routes should work fine then.
You can't access your laravel application routes straight away through the folder structure with xampp. You need to setup the web root to point to the public
folder and access localhost
or run the laravel server and use it. This is because the url rewriting would fail when you access the routes in laravel the way you do.
Upvotes: 1