Q:

之前使用

php -S localhost:8000

指令把php server架起來。

如果想要執行另外一個專案會出現

Failed to listen on localhost:8000 (reason: Address already in use)

錯誤訊息。

這時必須先停止原本的執行緒,再執行另外一個專案。

 

A:

open a terminal and type:

 

ps -ef | grep php

 

it will list the php process with the pid (process id)

something like

 

$ ps -ef | grep php

  501 14263 14133   0 10:25AM ttys001    0:00.21 php -S localhost:8000

  501 14355 14265   0 10:25AM ttys002    0:00.00 grep php

 

The note the number for the line that lists your php process, the second column is your pid in the example the process id us 14263, kill it:

 

$ kill 14263

 

do another ps

 

$ ps -ef | grep php

  501 14358 14265   0 10:26AM ttys002    0:00.00 grep php

$

 

The process should not be listed anymore

--

轉自 https://stackoverflow.com/questions/25608908/stopping-in-built-php-server-on-mac-mavericks-livecode

--

arrow
arrow
    全站熱搜

    dizzy03 發表在 痞客邦 留言(0) 人氣()