PHP Artisan Serve not Working in Laravel

03-Apr-2023

.

Admin

PHP Artisan Serve not Working in Laravel

Hello Friends,

In this short tutorial we will cover a php artisan serve not working in laravel. I’m going to show you about laravel php artisan serve not working. This article goes into detail on the laravel command php artisan serve not working. you can understand the concept of php artisan serve not working ubuntu laravel. Here, Creating a basic example of php artisan serve does not work code example of laravel.

Generally, the 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 the laravel application using php.

You can use this example with the versions of laravel 6, laravel 7, laravel 8, and laravel 9.

You have just to follow the below step and you will get the layout as below:

Example 1: Run Laravel App using php Command


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

cd your_project_folder

php -S localhost:8000 -t public/

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

http://localhost:8000

Example 2: Run Laravel App with Different Port

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

cd your_project_folder

php -S localhost:9000 -t public/

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

http://localhost:9000

Example 3: Run Laravel App with Different Host

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

cd your_project_folder

php -S 127.0.0.1:9000 -t public/

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

http://127.0.0.1:9000

I hope it can help you...

#Laravel