LoginSignup
0
0

More than 1 year has passed since last update.

【PHP】ビルトインサーバーの使い方

Posted at

自分用のメモです。

ビルトインサーバーとは

  • PHPでのプログラム開発サポート用に組み込まれているサーバー環境のこと。

  • ローカル環境はXAMPPやMAMPなどの環境を用意してPHPを動かしている方も多いと思いますが、PHPの場合、ビルドインサーバーを使うとコマンド1つで手軽にローカルサーバーの立ち上げができるので便利です。

  • ただし、ビルトインサーバーはあくまで簡易的な環境のため、データベースなどと連携したい場合は、自前で用意する必要があります。

ビルトインサーバー立ち上げ〜ブラウザでの表示方法

作業フォルダへ移動

$ cd sample_dr

立ち上げる

$ php -S localhost:8000

(例)sample.phpファイルを表示させたい場合

http://localhost:8000/sample.php にアクセス
0
0
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
0
0