Laravel - php artisan serve not working - Solution
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...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- Laravel Contact Form Send Email Tutorial
- Laravel Google ReCaptcha V3 Tutorial Example
- Laravel Google ReCaptcha V2 Example Tutorial
- Laravel Send an Email on Error Exceptions Tutorial
- Laravel 9 Localization Guide Example Tutorial
- Laravel 9 Socialite Login with Twitter Account Example
- Laravel 9 Eloquent Mutators and Accessors Example
- How to Add Two Factor Authentication with SMS in Laravel?
- How to Create Custom Log File in Laravel?
- Laravel Signature Pad Example Tutorial