0

When running of laravel site, it requires php artisan serve command. Now, I want to execute this on a VPS web server permanently. It means that, I want to run this on the webserver and not on my local pc. The problem is, I don't know how it is done.

Does anybody know?

smzapp
  • 809
  • 1
  • 12
  • 33

2 Answers2

4

Laravel doesn't require the artisan:serve command, it requires a web server, and what the command does is that it just starts the php built-in server.

In other words, in your hosting, you just have to correctly set up nginx to point to your public folder and it should work normally.

Rafik Tighilt
  • 2,071
  • 1
  • 15
  • 27
3

In Vps server you dont need to run php artisan serve.Just point your domain to your laravel project folder for example if your project folder laravel then point your domain to

laravel/public 

The `Serve command is just a shortcut for the PHP Builtin Webserver, something PHP has out of the box, so the point of using it is to start testing your application as fast as you could, you just need to install PHP, Composer and your application is up (if you don't need anything else, of course). But if you already have Nginx installed, there is no point at all, just use it.

It's not wise to use the Builtin Webserver in production.

Yuo can read more about here http://php.net/manual/en/features.commandline.webserver.php

Ref: Whats the point of running Laravel with the command 'php artisan serve'?

Vision Coderz
  • 8,257
  • 5
  • 41
  • 57
  • thanks. By the way, on some other hostings, I have read that in some case, they need to reset the server. In local pc, we just simple press CTRL + C and then run `php artisan again`. How should we do this on vps? – smzapp Sep 25 '17 at 17:04
  • if you are using windows pc then you can use putty .if its ubuntu you can connect thorugh terminal – Vision Coderz Sep 25 '17 at 17:05