> For the complete documentation index, see [llms.txt](https://tony915.gitbook.io/laravel-4-2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tony915.gitbook.io/laravel-4-2/ji-ben-pei-zhi-she-ding/development-environment.md).

# 建立開發環境

為了快速建立開發環境，避免鎖碎的安裝，我們們會使用整合式開發環境工具來建立。這些工具同時整合了 Apache 及 MySQL 伺服器及 PHP 語言等，並且只適合在本機(也就是你的電腦)上運作。

！記得，Laravel 4 必須使用 PHP 5.4 以上的版本，還好目前的工具都有支援。

## Windows

直接下載 [WAMP](http://www.wampserver.com/en/)\[1] 安裝即可。

## Mac

直接下載 [MAMP](http://www.mamp.info/en/)\[2] 安裝。MAMP 也有出 [MAMP for Windows](http://www.mamp.info/en/mamp_windows.html)\[3] 的版本，可自行選擇。

## PHP 版本

在 Mac 中，有可能要指定 PHP 執行檔的位置，否則會出現找不到 PHP 或因為之前安裝過 PHP 而執行到之前安裝的版本。這個動作只有在你的系統上的 PHP 版本小於 5.4 版的情況下才需要額外設定。

打開終端機，輸入 vim \~/.bash\_profile 在前面加入

```
export PATH=/Applications/MAMP/bin/php/php5.5.14/bin:$PATH
```

這個動作會把 "/Applications/MAMP/bin/php/php5.5.14/bin" 這段路徑加入你的 PATH 中，你的 PHP 版本可能會不同，請自行調整，這樣你就會使用 MAMP 所提供的 PHP 了。

## 開發工具

你可能已經有正在使用的程式碼編輯工具，假如沒有，推薦使用 [Sublime Text 3](http://www.sublimetext.com/3)\[4]，後面還會介紹如何使用外掛套件，讓 Sublime Text 幫你產生檔案，省去終端機打指令的麻煩。

* \[1] <http://www.wampserver.com/en/>
* \[2] <http://www.mamp.info/en/>
* \[3] <http://www.mamp.info/en/mamp_windows.html>
* \[4] <http://www.sublimetext.com/3>
