I have a Laravel project. I would like to know how can I run it and view the pages on my browser? Like for example, if I had a Django project, I would simply cd to it and type "python manage.py runserver" in the terminal to run the project. How can I do this with a Laravel Project?
Asked
Active
Viewed 1,609 times
3 Answers
2
Use the artisan serve
command:
php artisan serve

Joseph Silber
- 214,931
- 59
- 362
- 292
-
So just cd to the project folder and run "php artisan serve"? – Plato Aug 25 '14 at 16:59
-
@Plato - Try it and see :) – Joseph Silber Aug 25 '14 at 16:59
-
Hi, I just tried that but it gives me an error "Laravel requires Mcrypt PHP Extension". But I already have it installed (I ran sudo apt-get install php5-mcrypt) – Plato Aug 25 '14 at 17:09
-
@Plato - Which version of PHP do you run? – Joseph Silber Aug 25 '14 at 17:12
-
@Plato - Follow the instructions here: http://stackoverflow.com/questions/16830405/laravel-requires-the-mcrypt-php-extension#answer-24507004 – Joseph Silber Aug 25 '14 at 19:18
0
I like the bare php command more, it provides some nice colors, green for OK, red for errors.
php -S localhost:8000 -t public/
Or even:
echo "php -S localhost:8000 -t public/" > start_server.sh
sh start_server.sh

MGP
- 2,981
- 35
- 34
0
Depends on your operating system (OSX, Windows, Linux) but I find that the software Laragon https://laragon.org is very good in providing everything you need, including apache, mysql, editing the host file, and sending (test) emails.

Alexie
- 1
- 2