#### 1. 前言 --- PHP從5.4開始,就提供了一個內(nèi)置的web服務(wù)器。 這個主要是用來做本地的開發(fā)測試用的,不能用于線上環(huán)境。 **將PHP的安裝路徑配置到電腦的系統(tǒng)環(huán)境變量Path中,下圖是win7,win10中會看的更清楚**  #### 2. 進入項目目錄,執(zhí)行命令 --- **a. 啟動php內(nèi)置服務(wù)器** ``` php -S localhost:8080 ```  **b. 瀏覽器測試訪問**  #### 3. 命令參數(shù) --- **-S 訪問地址:端口,通過內(nèi)置web服務(wù)運行php** ``` php -S localhost:8080 ``` **-t 站點根目錄,指定web服務(wù)的網(wǎng)站根目錄** ``` php -S localhost:8080 -t 運行目錄 ```  **訪問指定的文件** ``` php -S localhost:8080 index.php ```