Reputation: 1754
When we are developping a Laravel app, we can use
php artisan serve
to serve Laravel. However, I saw in other StackOverflow posts that we should NEVER use this command for production
So, how can we serve Laravel? Is there a command for it? I couldn't find a straightforward tutorial that teaches how to deploy Laravel for production.
Upvotes: 0
Views: 109
Reputation: 1754
Unfortunately, edits to Filipe Ferreira's answer have been rejected. Here is some important information on how to deploy Laravel4 to apache
You can point the server on the config file to the public folder for example in apache:
Change DocumentRoot "C:/xampp/htdocs" to DocumentRoot "C:/laravel/appname/public/"
On the production Server
Or, in Linux, you can follow the steps described HERE
Also, when deploying, DO remember to have mod_rewrite enabled
sudo a2enmod rewrite
And to configure your .htaccess file, as shows HERE
Upvotes: 0
Reputation: 6676
php artisan serve
uses PHP's build in web server which is designed purely for development purposes. In order for this to work for everyone else, you're going to need a more powerful server.
You're main two options will be Apache and Nginx. I don't want to recommend any guides because I haven't read any (I learned on the job so I might be doing things wrong myself). However, the internet is full of guides, and articles describing the differences between the two.
Upvotes: 1
Reputation: 330
You can point the server on the config file to the public folder for example in apache:
Change DocumentRoot "C:/xampp/htdocs" to DocumentRoot "C:/laravel/appname/public/"
On the production Server
Upvotes: 1