3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Docker for MacでPHP-FPMがエラー(9000 failed: port is already allocated)

Last updated at Posted at 2018-01-10

概要

今まで、vagrantでCentOSを起動し、dockerを使っていたが、
Docker for Macが便利そうなので使ってみたら、PHPが起動しなかったので、
調べた結果をメモに残しておく。

エラー内容

どうも9000ポートが使われていると怒られたみたい。

ERROR: for php  Cannot start service php: driver failed programming external connectivity on endpoint php (ec901c1c728298639448dc8ea1f049f1b3d2bbadc3618a6562535afc8d9cc86a): Error starting userland proxy: Bind for 0.0.0.0:9000 failed: port is already allocated
ERROR: Encountered errors while bringing up the project.

誰が9000ポート使っているか?

下記コマンドで調べられるようなので実行してみると...

$ lsof -i :9000
COMMAND   PID     USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
idea    14197  sono  799u  IPv4 0x833fd9533585d4d1      0t0  TCP *:cslistener (LISTEN)

どうやら、IntelliJさんが使ってそう・・・
IntelliJの設定を確認して見るとPHPがデバッグで9000ポートを使っていた。

Preferences -> Languages & Frameworks -> PHP -> Debug

Xdebugの項目の「Debug port:9000」がどうも原因のようなので、9001に変更する。

参考サイト

3
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?