在laravel中恢复'php artisan serve'命令
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23932127/
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
revert 'php artisan serve' command in laravel
提问by halkujabra
I have a laravel app. I ran 'php artisan serve'
command for local testing and my app was served at localhost:8000. But now I want to stop serving it at localhost:8000ie., I want it not to serve now.
我有一个 Laravel 应用程序。我运行'php artisan serve'
命令进行本地测试,我的应用程序在localhost:8000 上提供服务。但是现在我想停止在localhost:8000 上提供服务,即,我希望它现在不提供服务。
I closed the command line, restarted the server but it is still serving. How can it be done?
我关闭了命令行,重新启动了服务器,但它仍在服务。怎么做到呢?
Note:I am using windows for testing purposes.
注意:我使用 Windows 进行测试。
回答by Mohammed Omer
here is what i do
press ctrl
+ c
这是我所做的按ctrl
+c
> lsof -i :8000
to check if the port is busy or not if any process is listening to the port 8000 it will be displayed with port id
检查端口是否繁忙,如果有任何进程正在侦听端口 8000,它将显示端口 id
> sudo kill -9 [PID]
kill the process that listen to that port id
杀死监听那个端口号的进程
run lsof agin
运行 lsof gin
> sudo lsof -i 8000
vola
沃拉
回答by jsalonen
Press Ctrl
+ Shift
+ ESC
. Locate the php process running artisan and kill it with right click-> kill process
.
按Ctrl
+ Shift
+ ESC
。找到运行 artisan 的 php 进程并右键单击->杀死它kill process
。
Reopen the command-line and start back the server.
重新打开命令行并重新启动服务器。
Note that you should be able to kill the process just by sending it a kill signal with Ctrl
+ C
.
请注意,您应该能够通过使用Ctrl
+向其发送终止信号来终止该进程C
。
回答by David Noleto
I used Ctrl+ Cin my mac for stop the command php artisan laravel serve
我在我的 mac 中使用Ctrl+C来停止命令 php artisan laravel serve
回答by T-Bee
For windows user, type this command for showing the list of current running php artisan process:
对于 Windows 用户,键入此命令以显示当前正在运行的 php artisan 进程列表:
tasklist /FI "IMAGENAME eq php.exe"
Will show:
将会呈现:
Image Name ---- PID ---- Session Name ---- Session ---- Mem Usage
php.exe --------- XXXX ---- Console ---------- 4 ------- 19.852 K
Look up PID number (XXXX), and type this to kill the process:
查找 PID 号 (XXXX),然后键入以下内容以终止进程:
taskkill /F /PID XXXX
回答by mareq133
Windows 10 with XAMPP server depending on what shell you use to run:
带有 XAMPP 服务器的 Windows 10 取决于您用来运行的 shell:
php artisan serve
In Windows CMD: CTRL+ C
In XAMPP Shell: CTRL+ Pause/Break
In Ubuntu and RedHat/CentOS terminal it's: CTRL+ C
在 Windows CMD 中:CTRL+C
在 XAMPP Shell 中:CTRL+Pause/Break
在 Ubuntu 和 RedHat/CentOS 终端中:CTRL+C
回答by Deepanjan Bhattacharyya
Ctrl+ Pause|Breakshould do it for Windows.
Ctrl+Pause|Break应该为 Windows 做。
回答by Jay LampStack
If your using VS Code, simply do the following:
如果您使用 VS Code,只需执行以下操作:
- Open VS Code terminal
- Find the drop down box that displays a list of all the running shells
- Select "php" from the list and click the garbage bin icon
- 打开 VS Code 终端
- 找到显示所有正在运行的 shell 列表的下拉框
- 从列表中选择“php”,然后单击垃圾箱图标
This deletes the shell and kills the server.
这将删除外壳并杀死服务器。