7
5

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 5 years have passed since last update.

phpとpythonのcgi実行可能な簡易WEBサーバーの起動方法

Last updated at Posted at 2016-02-03

以下のコマンドはpythonまたはphpがインストールされていれば使えます。
※古いバージョンでは使えない場合もあり。

コマンドを実行したディレクトリがwebrootになります。

python

python3の場合

コマンド
python -m http.server --cgi 8000

python2の場合

コマンド
python -m CGIHTTPServer 8000

php

php5.4〜

コマンド
php -S localhost:8000

pythonもphpもポート番号は指定しない場合、デフォルトで8000が割り当てられます。

7
5
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
7
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?