1

I am pretty new in Laravel and I am finding the following problem.

I have put my application in this folder:

C:\xampp\htdocs\HotelRegistration\

Starting it via the statment:

php artisan serve

it is correctly started here: http://127.0.0.1:8000

For some reason I need to run it with XAMPP Apache server instead the one provided by php artisan serve

So I started Apache from XAMPP but trying to open:

http://127.0.0.1:80/HotelRegistration/

but so the application can't start and I obtain the list of directory and file contained in this folder.

Why? What is wrong? What am I missing? Maybe something related to virtual host? How can I fix this issue?

Tnx

3
  • you have apache configured to use 8080 port? by default it will run on the 80 port Commented Feb 22, 2017 at 12:12
  • @LordNeo I have modified my original post Commented Feb 22, 2017 at 12:17
  • 1
    Ok, thing is, the php artisan serve command doesn't serve that folder but the public one inside, so if you open that you should see your app Commented Feb 22, 2017 at 12:18

3 Answers 3

3

php artisan serve creates a web server that shows the public folder of your app.

As a good practice, you should setup your hosting to show that public folder while hidding the rest of the program from unwanted visitors.

Check this links about it:

https://medium.com/laravel-news/the-simple-guide-to-deploy-laravel-5-application-on-shared-hosting-1a8d0aee923e

https://deployer.org/blog/how-to-deploy-laravel

For development, that isn't too much of a trouble.

Sign up to request clarification or add additional context in comments.

Comments

0

You can use the below to run your application. But it can fail to load the basic css file.

http://localhost/HotelRegistration/public/

Hope its help you.

1 Comment

Then check routes/web.php page add the below code if not added.Route::get('/', function () { return view('welcome'); });
0

Solved by myself, I create a virtual host in Apache and using this URL works

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.