0

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?

3 Answers 3

2

Use the artisan serve command:

php artisan serve
Sign up to request clarification or add additional context in comments.

5 Comments

So just cd to the project folder and run "php artisan serve"?
@Plato - Try it and see :)
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 - Which version of PHP do you run?
@Plato - Follow the instructions here: stackoverflow.com/questions/16830405/…
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

Comments

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.