環(huán)境搭建這種事情,最重要的是先貼上時間,和工具版本,供以后迭代參考。
環(huán)境搭建時間:2018年08月22日
環(huán)境信息:【MacOS】 10.3.16? 【PHP】 7.0.30? 【Apache】 【MySQL】5.7.21
MAMP PRO:Version 5.0.1(15379)
PhpStorm:PhpStorm 2018.2.1 Build #PS-182.3911.43, built on August 8, 2018
MAMP設(shè)置
1.設(shè)置Hosts

1.MAMP-Hosts設(shè)置
2.設(shè)置Ports

2.MAMP-Ports設(shè)置
3.設(shè)置MySQL

3.MAMP-MySQL設(shè)置
4.設(shè)置PHP
2018年08月25日12:25:36添加:在PHP設(shè)置的Log errors的選項中要勾上"to screen"選項,這樣可以在瀏覽器中輸出錯誤信息,方便開發(fā)調(diào)試。

4.MAMP-PHP設(shè)置
PhpStorm設(shè)置
1.設(shè)置Server
PhpStorm→Preferences...→Languages&Frameworks→PHP→Servers

1.PhpStorm-Server設(shè)置
2.設(shè)置項目部署(Deployment)
PhpStorm→Preferences...→Build, Execution, Deployment→Deployment
PS:此項目如果配置不正常,則會出現(xiàn)PHP頁面獲取不到POST數(shù)據(jù)的問題。

2.PhpStorm-Deployment設(shè)置
3.設(shè)置PhpStorm的PHP解釋器版本(PHP解釋器由MAMP提供)
PhpStorm→Preferences...→Languages&Frameworks→PHP

3.1.PhpStorm-PHP解釋器設(shè)置

3.2.PhpStorm-CLI Interpreter設(shè)置
4.設(shè)置PHP Remote Debug(作為Run的環(huán)境)
右上角“Edit Configurations...”,這里的設(shè)置我不是很確定是否正確,希望有人能指教下,文明交流。

4.1.PhpStorm-EditConfiguration

4.2.PhpStorm-PHP Remote Debug
5.配置選用的PHP解釋器對應(yīng)的php.ini文件
在3.設(shè)置PhpStorm的PHP解釋器版本中配置CLI Interpreter時有要求點擊Open In Editor,于是出現(xiàn)如下配置文件,進行配置

5.PhpStorm-CLI的php.ini文件配置