[LINUX] · Address already in use solution

Introduction

When I started the server while learning PHP ... Since it came out as follows, I will summarize the remedy It may be difficult to write and read for the first time, but I hope it helps someone.

[vagrant@localhost]$ php -S 192.168.33.10:8000
Failed to listen on 192.168.33.10:8000 (reason: Address already in use)

Cause

I closed the putty terminal to turn off the PHP server, The server is in use and has an error at startup

Even after solving it, if you do this, it will be quite troublesome to type commands, so We strongly recommend that you turn off the server before closing it.

Solution

#Log in as root user to check the process
//If you have trouble logging in as root, please add sudo when you type the command.
[vagrant@localhost ~]$ ps -a


#If you know the port, check below
[vagrant@localhost ~]$ lsof -i:8000


#If you can't lsof, install below
[vagrant@localhost ~]$ yum -y install lsof


#When you type the above command, the running server information including PID will be displayed as shown below.
COMMAND  PID    USER     FD   TYPE  DEVICE  SIZE/OFF NODE  NAME
php      10721  vagrant  3u   IPv4  20710     0t0    TCP   192.168.33.10:irdmi (LISTEN)


#kill (PID number)Enter to end the process
[vagrant@localhost ~]$ kill 10721


#It will start when you type the command again
[vagrant@localhost ~]$ php -S 192.168.33.10:8000 
PHP 5.6.40 Development Server started at Mon Jan  6 12:21:24 2020 Listening on http://192.168.33.10:8000


#If killing does not help, kill-9 (PID number)Please forcibly terminate with
[vagrant@localhost ~]$ kill -9 10721 

in conclusion

This time I wrote about the kill </ font> command, but if you want to know more Click on the kill letter for more information If you have any suggestions, I would appreciate it if you could comment! !! Thank you for reading to the end

Recommended Posts

· Address already in use solution
Resolve the Address already in use error
Date of Address already in use error in Flask
Error in Flask OSError: [Errno 98] Address already in use
Use config.ini in Python
Use DataFrame in Java
Use Mean in DataFrame
Use Valgrind in Python
Use ujson in requests
Use profiler in Python
The day you killed the process (flask gave an error saying Address already in use)
Let's use def in python
Use "$ in" operator with mongo-go-driver
Use let expression in Python
Use Measurement Protocol in Python
Use callback function in Python
Use parameter store in Python
Use HTTP cache in Python
Use regular expressions in C
Use list-keyed dict in Python
[Python] Insert ":" in MAC address
Use regular expressions in Python
Use Spyder in Python IDE
Use Juman ++ in server mode
Use jinja2 template in excel file
Use optinal type-like in Go language
How to use classes in Theano
Mock in python-how to use mox
Use watchdog (watchmedo) in test-driven development
How to use SQLite in Python
Solution for ValueError in Keras imdb.load_data
How to use Mysql in python
Use Python in pyenv with NeoVim
How to use ChemSpider in Python
Hash method (open address method) in Python
How to use PubChem in Python
Use django-debug-toolbar in VirtualBox / Vagrant environment
Use OpenCV with Python 3 in Window