Laravel - php artisan serve not working - Solution

By Hardik Savani May 14, 2024 Category : Laravel

This post will give you example of laravel php artisan serve not working. I would like to show you php artisan serve not working ubuntu laravel. you can see php artisan serve not working in laravel 9. let’s discuss about laravel command php artisan serve not working. Let's see bellow example php artisan serve not working in laravel.

You can use this example with laravel 6, laravel 7, laravel 8, laravel 9, laravel 10 and laravel 11 version.

Generally, php artisan serve command works perfectly. Even port is busy then it starts with another port. but even if it's not working with you then I will help you manually run laravel application using php. so let's see the following ways to run your laravel app without using php artisan serve command:

Example 1: Run Laravel App using php Command

Here, we will go to project and then we will simply run bellow command to run laravel app.

cd your_project_folder

php -S localhost:8000 -t public/

Now, you are able to access project with following URL:

http://localhost:8000

Example 2: Run Laravel App with Different Port

Here, we will go to project and then we will simply run bellow command to run laravel app with different port.

cd your_project_folder

php -S localhost:9000 -t public/

Now, you are able to access project with following URL:

http://localhost:9000

Example 3: Run Laravel App with Different Host

Here, we will go to project and then we will simply run bellow command to run laravel app with different host.

cd your_project_folder

php -S 127.0.0.1:9000 -t public/

Now, you are able to access project with following URL:

http://127.0.0.1:9000

You will find following layout for your laravel app:

I hope it can help you...

Tags :
Shares