Перейти к содержимому

Php artisan serve как остановить

  • автор:

Остановить сервер laravel с помощью интерфейса командной строки

Я просто попытался автоматизировать процесс laravel, например (Start, Stop) в сценариях оболочки. Чтобы запустить сервер laravel, я использую php artisan serve в файле оболочки.

Я попытался остановить сервер laravel с помощью команды. Но мне было интересно, я не видел никаких команд для остановки сервера. Я использовал Ctrl + C, чтобы остановить сервер или закрыть командную строку.

1.Любые команды laravel для остановки сервера?

  1. Я запустил сервер laravel с помощью файла оболочки, который закрывается после запуска.

Как мне их остановить сейчас? У меня нет командных подсказок, запускающих этот процесс для выхода с сервера.

Остановите сервер laravel с помощью интерфейса командной строки

Я просто попытался автоматизировать процесс laravel, такой как (Start, Stop) в сценариях оболочки. Чтобы запустить сервер laravel, я использую php artisan serve в файле оболочки.

Я попытался остановить сервер laravel, используя команду. Но мне было интересно, я не видел никаких команд, чтобы остановить сервер. Я использовал Ctl+C, чтобы остановить сервер или закрыть командную строку.

1. Любые команды laravel, чтобы остановить сервер?

  1. Я запустил сервер laravel, используя файл оболочки, который завершается после запуска.

Как я могу остановить их сейчас? У меня нет командных строк, запускающих этот процесс для выхода из сервера.

How To Stop Php Artisan Serve

When you are developing a Laravel application, you may use the built-in PHP development server provided by
the php artisan serve command. This command starts a local server that allows you to test your
application without configuring a full-fledged web server like Apache or Nginx.

However, there may be instances where you need to stop the server. In this blog post, we will discuss how to
stop the PHP Artisan server.

Stopping PHP Artisan Serve

The PHP Artisan server can be stopped using the keyboard shortcut Ctrl + C or
Cmd + C (for macOS users). This will immediately terminate the server process.

To stop the server, simply press the Ctrl + C (or Cmd + C on macOS) keys on your
keyboard while your terminal window is in focus. You should see a message like “Terminated” or “Shutdown
requested”.

Here’s an example of what you might see when stopping the PHP Artisan serve:

When using the keyboard shortcut, it’s important to make sure that your terminal window is in focus, and not
another application, to ensure the server is successfully terminated.

Alternative Method: Killing the Process Manually

In some cases, you might need to stop the PHP Artisan server manually. For example, if you accidentally closed
the terminal window where the server was running, you won’t be able to use the keyboard shortcut to stop the
server.

To stop the server manually, you need to find the process ID (PID) of the server and then use the kill command.
Here’s how to do it on different operating systems:

On Linux and macOS

  1. Open a terminal window and use the following command to find the PID of the PHP Artisan server process:

The PHP Artisan server should now be stopped.

On Windows

  1. Open a command prompt and use the following command to find the PID of the PHP Artisan server process:

Conclusion

Stopping the PHP Artisan server is an easy task. You can either use the keyboard shortcut Ctrl + C (or
Cmd + C on macOS) or manually kill the process using its PID. Remember to always stop your server before
closing your terminal window to avoid any issues when starting a new server session.

Ezoic

report this ad

Disclaimer

This site earns money from ads and affiliate links. If you click on a link to a product we may make a small commission on your purchase. Thanks for supporting us.

How to exit the command stream when running php artisan serve?

I am suing command prompt on windows. When I run php artisan serve the command prompt enters some kind of command stream where you can not use the command line anymore. How to exit this stream so that I could use the command line? Also, does this mean that exiting this mode will stop serving the app?

3 Answers 3

php artisan serve means you create a server. as long as this server running you can view your created website in browser at http://localhost:8000 . what you said as ’some kind of command stream’ is things that server is serving. Yes exiting command prompt will terminate the php artisan serve means when you access http://localhost:8000 there will no website to be seen anymore.

You can terminate the server by Ctrl+c OR just open another cmd prompt and keep php artisan running

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *