Przemek
Przemek

Reputation: 822

Xampp localhost not working

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

Answers (3)

Ramsis
Ramsis

Reputation: 1

I tried this in MX Linux 21.xx. My xampp got messed up after installing larvel on it.

  1. check MySQL status with command
mysql service status
  1. stop the service using the command
service mysql stop
  1. you will be prompted to provide your password, Enter password.

  2. start xampp using command

sudo /opt/lampp/lampp start
  1. All should be back to normal

Upvotes: 0

Exprator
Exprator

Reputation: 27513

if you want to access laravel project without running artisan serve, you need to change few settings,

  1. copy the .htaccess file from the public folder and paste it in the root folder of your application

  2. 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

Sandeesh
Sandeesh

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

Related Questions