Mac PHP PhpStorm php-cgi not found问题

OS X 10.10之后自带了PHP环境,但是很多时候无法满足开发的需要。

本文记录了,自己安装php环境,以及使用Phpstorm时遇到的一些问题。

一、PhpStorm的 php-cgi not found问题(设置php Interpreter)

很好用,具体的安装以及使用,网上已经有了很多教程。
安装好后创建php工程,编写helloworld。如下图

《Mac PHP PhpStorm php-cgi not found问题》 Hello World.png

然后在浏览器里面查看效果,下图红色箭头处,这时会看到网页出现502错误。或者查看
此文章出现的错误

《Mac PHP PhpStorm php-cgi not found问题》 查看效果.png

重点是记录:怎么给Phpstorm配置php Interpreter 。
自己安装PHP环境
我用的是brew安装,在brew中会有很多的php版本,下拉可以看到一个homebrew/php/php56
使用命令 brew install homebrew/php/php56

《Mac PHP PhpStorm php-cgi not found问题》 brew中的php版本.png

然后等待安装完成,PATH也会自动完成设置,如果没有完成的,自行查找设置方法。

最后的php-cgi的目录,设置好Interpreter就ok了。

《Mac PHP PhpStorm php-cgi not found问题》 php-cgi目录.png

问题持续更新中

    原文作者:不会游泳De鱼
    原文地址: https://www.jianshu.com/p/afbedeb21ea2
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞