Mac OS 10.14.1 配置 phpstorm 和 xdebug

一定不要用Mac OS自带的PHP版本。

此文主要解决,error,xdebug.c:25:10: fatal error: 'php.h' file not found

1,安装php

>>brew search php

>>brew install [email protected]

2,解决xdebug安装时报error

重启Mac系统,按住command+R,打开命令行,输入如下:

csrutil disable

等你配置好xdebug,再修改回来,否则,没有权限操作/usr/文件夹下的内容

csrutil enable

>>xcode-select --install

>>sudo ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include /usr/include

注意,将MacOSX10.14替换成你自己的系统版本号

上面这个命令用来解决安装xdebug时的,error,xdebug.c:25:10: fatal error: 'php.h' file not found

3,安装pear,即pecl命令

不再描述了,参考这里,https://www.jianshu.com/p/598c0fd84719

4,安装xdebug

>>sudo pecl install xdebug

5,在php.ini中配置xdebug

/usr/local/etc/php/7.1/php.ini

在最末尾部加入如下:

zend_extension="/usr/lib/php/extensions/no-debug-non-zts-20160303/xdebug.so"
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.profiler_enable=1
xdebug.idekey = PHPSTORM

6,在phpstorm中配置debug

这一步,大家还是网上搜索吧,不再一一描述

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章