Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel with xampp

Tags:

php

laravel

xampp

I need to understand this behavior.

I use xampp for web development. I start to apache server in the xampp gui and then I can start my projects in the browser via localhost...

Since yesterday I have added laravel to my mac book. My project is in the xampp htdocs folder and I want to use it witch xampp. But when the xampp apache server instance is running, nothing is happened to my laravel project until I run php artisan serve in the cmd.

How can I combine larael with xampp? And what exactly does php artisan serve do? Start another apache server instance?

like image 894
HansMuff Avatar asked Jul 09 '17 12:07

HansMuff


2 Answers

The artisan command is just a command line utility for laravel. The serve command just starts up the PHP server.

to run it without artisan you can Configure a server virtual-host (Apache or Nginx) which have the public directory of your project as root directory. Since you are using a MAC I can't exactly instruct you to how to do that.

NOTE

this will help to create the virtual host. but i haven't tried that

like image 103
pavithra rox Avatar answered Sep 16 '22 18:09

pavithra rox


sorry i can't comment due to reputation :/ i use lumen (rest api of laravel) with xampp and it works fine. Can you provide somemore details? I also think the path is the problem. Which path you use to access it via a browser? for lumen its /htdocs/project/public/ so in browser: http://localhost/project/public/ there i can access the api. should be similar for full laravel project?

like image 40
Hendrik Avatar answered Sep 16 '22 18:09

Hendrik