How to run multiple Laravel projects at same time?
You can also run web server on multiple port in PHP application by the following command.
php -S localhost:8000
php -S localhost:8080
First run your first laravel project blog as follows: Open your command prompt and go to your drive where your laravel project exist. And type php artisan serve
C:\xampp\htdocs\blog>php artisan serve
Now type http://localhost:8000 in browser and your blog project will run.
Again open another command prompt and again go to your another laravel project bloganother
C:\xampp\htdocs\bloganother>php artisan serve --port=8080
Now go to your browser and type http://localhost:8080 in your browser your another project will also run.
tl;dr one cannot have more than one listener per TCP
port at the same time. If you need more web server instances: try another port:
php artisan serve --port=8001
then go to http://localhost:8001
References:
- Can two applications listen to the same port?
- https://laravel.com/docs/8.x