如何同时运行多个 Laravel 项目?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/43817947/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 15:55:17  来源:igfitidea点击:

How to run multiple Laravel projects at same time?

laravellaravel-5.4

提问by Amin Adel

To run one laravel project we only need to type "php artisan serve". and it will be available on port 8000.

要运行一个 Laravel 项目,我们只需要输入“php artisan serve”。它将在端口 8000 上可用。

But sometimes we need to run multiple projects at the same time. How can we do this?

但有时我们需要同时运行多个项目。我们应该怎么做?

回答by emix

tl;drone cannot have more than one listener per TCP port at the same time. If you need more web server instances try another port:

tl; drone 不能同时在每个 TCP 端口上有一个以上的侦听器。如果您需要更多 Web 服务器实例,请尝试另一个端口:

php artisan serve --port=8001

then go to http://localhost:8001

然后访问http://localhost:8001



Reference:

参考:

回答by Nazmul Hasan

You can also run web server on multiple port in PHP application by the following command.

您还可以通过以下命令在 PHP 应用程序的多个端口上运行 Web 服务器。

php -S localhost:8000 
php -S localhost:8080

回答by Shubham Sunny

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

首先运行你的第一个 laravel 项目博客,如下所示: 打开你的命令提示符并转到你的 laravel 项目所在的驱动器。然后输入 php artisan serve

C:\xampp\htdocs\blog>php artisan serve

Now type http://localhost:8000in browser and your blog project will run.

现在在浏览器中输入http://localhost:8000,你的博客项目就会运行。

Again open another command prompt and again go to your another laravel project bloganother

再次打开另一个命令提示符并再次转到您的另一个 Laravel 项目 bloganother

C:\xampp\htdocs\bloganother>php artisan serve --port=8080

Now go to your browser and type http://localhost:8080in your browser your another project will also run.

现在转到您的浏览器并在您的浏览器中输入http://localhost:8080您的另一个项目也将运行。

Thank you for reading this article. Hope your problem get solved.

感谢您阅读这篇文章。希望你的问题得到解决。

You can also get your solution from this link

您也可以从此链接获取解决方案