How to run Laravel Project without using PHP Artisan Serve

Laravel Projects usually use the command php artisan serve in order for the project to be deployed on your browser. To make it less hassle and to make it easier to access your Laravel Project, read the steps below.

Find the configuration you setup when you installed Laravel, in this case laravel.conf is the name of the text file.

In there, input the following or change the DocumentRoot and Directory into the parent folder of your project.

After changing the text file, you need to include the ServerName on hosts folder found in etc.

In order for the changes to be noticed by your server, use the commands:

$ systemctl restart apache2  -- To restart the apache2 on your Ubuntu.
$ sudo a2enmod rewrite       -- To enable rewrite on the module you changed.
$ sudo a2ensite laravel.conf -- To enable Laravel site.

After doing the steps above, you can see that the Laravel Project can be accessed through URL ‘http://localhost’ and ‘http://server-name’ without the php artisan serve command.

Leave a Comment

Your email address will not be published. Required fields are marked *