環(huán)境搭建這種事情恃慧,最重要的是先貼上時(shí)間周荐,和工具版本城丧,供以后迭代參考宛篇。
環(huán)境搭建時(shí)間: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
2.設(shè)置Ports
3.設(shè)置MySQL
4.設(shè)置PHP
2018年08月25日12:25:36添加:在PHP設(shè)置的Log errors的選項(xiàng)中要勾上"to screen"選項(xiàng)计福,這樣可以在瀏覽器中輸出錯(cuò)誤信息跌捆,方便開發(fā)調(diào)試。
PhpStorm設(shè)置
1.設(shè)置Server
PhpStorm→Preferences...→Languages&Frameworks→PHP→Servers
2.設(shè)置項(xiàng)目部署(Deployment)
PhpStorm→Preferences...→Build, Execution, Deployment→Deployment
PS:此項(xiàng)目如果配置不正常象颖,則會(huì)出現(xiàn)PHP頁面獲取不到POST數(shù)據(jù)的問題佩厚。
3.設(shè)置PhpStorm的PHP解釋器版本(PHP解釋器由MAMP提供)
PhpStorm→Preferences...→Languages&Frameworks→PHP
4.設(shè)置PHP Remote Debug(作為Run的環(huán)境)
右上角“Edit Configurations...”,這里的設(shè)置我不是很確定是否正確说订,希望有人能指教下抄瓦,文明交流。
5.配置選用的PHP解釋器對(duì)應(yīng)的php.ini文件
在3.設(shè)置PhpStorm的PHP解釋器版本中配置CLI Interpreter時(shí)有要求點(diǎn)擊Open In Editor陶冷,于是出現(xiàn)如下配置文件钙姊,進(jìn)行配置