開始寫 todolist 前,我們勢必要先將開發環境準備好,所謂工欲善其事必先利其器,準備好工具才能順利進行,就先來看看我們需要準備些什麼吧。
- 安裝 Xampp
- 安裝 Composer
- 安裝 Node.js
- 安裝 VScode
安裝 Xampp
xampp是集成網頁伺服器、資料庫、php的工具,能夠讓網頁開發者快速開發,免去一堆繁雜的安裝流程,既然我們要使用到php 框架,安裝php即是不可或缺的東西,另外我們要使用xampp的資料庫來存取資料,因此選擇使用xampp。
1.至官網下載xampp==> https://www.apachefriends.org/zh_tw/index.html ,選擇最新的php版本即可。

2.載下來後原則上就一直按下一步照預設即可,但如果不想裝那麼多東西,可以選擇需要的即可,因此將Apache、MySQL、PHP、phpMyAdmin勾起來吧。

3. 安裝完後將Xampp打開,會看到幾個選項,這裡我們只要將Apache、MySQL打開(Start)即可。

呈現綠色底表示已成功啟用。

啟用時發生錯誤
當出現下圖紅色錯誤訊息,大部分是因為port 80被佔用了,這時有兩種解決辦法,一是停用占用80port的軟體,另一是修改 httpd.conf 將他改為其他port。

選擇apache->Apache(httpd.conf),預設使用文字文件開啟,使用快速搜尋功能Ctrl+F搜尋80。

將Listen 以及 Server Name localhost: 都改為8080。


安裝Composer
Composer是PHP的軟體包管理系統,之後我們建立Laravel專案時需要用到它。
1.一樣至官網下載Composer–> https://getcomposer.org/

2. 選擇Composer-setup.exe

3. 就一直按下一步安裝即可,比較值得注意的一點是如果事先已經安裝好xampp,PHP路徑會預先填好了。

4. 安裝完後打開命令提示字元(CMD)輸入composer若出現下圖表是安裝成功。

安裝 Node.js
1.至官網下載node.js–> https://nodejs.org/en/

2. 安裝完node.js後打開命令提示字元(CMD)輸入 node -v來查看版本號,若有成功出現,即表示安裝成功。

安裝VScode
Visual Stodio Code (簡稱 VScode),是一個基於網頁技術的新一代編輯器,由於能夠安裝各種外掛擴充套件,使的擁有極大的彈性,深受工程師們的喜愛,本教學使用vscode作為主要的編輯器,因此非常推薦。
1.至官網下載vscode–> https://code.visualstudio.com/

2. 安裝時強烈建議 將下面4個選項都勾起來,將來在專案資料夾使用滑鼠右鍵的選單中加入VScode快捷功能,在開啟專案時會方便許多。

以上即是Laravel Todolist 的環境架設,下一篇文章將會介紹laravel的專案建置。