2019-06-06 | PHP | UNLOCK

MAC下开发问题集锦

mac 下开发常见问题集锦,总结了我在 mac 下开发遇见的一些问题,都会记录在这里

mac 下phpize错误

问题

1
2
3
4
5
6
7
8
phpize
grep: /usr/include/php/main/php.h: No such file or directory
grep: /usr/include/php/Zend/zend_modules.h: No such file or directory
grep: /usr/include/php/Zend/zend_extensions.h: No such file or directory
Configuring for:
PHP Api Version:
Zend Module Api No:
Zend Extension Api No:

解决方案

1
2
3
ln -s /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include /usr/include

# MacOSX10.14.sdk 说明:10.14指的是你的mac的版本号,最好去看一下该路径存在不

参考地址

https://blog.csdn.net/json_vip/article/details/53192585

mac 下显示任何来源

问题

在“系统偏好设置”=>“安全性与隐私”=>没有“任何来源”

解决方案

1
2
# 在终端运行
sudo spctl --master-disable

参考地址

https://jingyan.baidu.com/article/afd8f4de8e55e734e286e92a.html

安装swoole找不到 openssl

问题

openssl/ssl.h file not found mac

解决方案

  1. 首先,确定自己是否真的有安装 openssl:brew install openssl,根据提示可以自己看到结果或者用brew info openssl也可以找到安装位置
  2. /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/中添加 openssl 文件夹
  3. 拷贝 include/openssl 下面的所有文件至第二步中建立的 openssl 文件夹中

参考地址

https://blog.csdn.net/qq_35007834/article/details/84566212

让 iTrem 2 + zsh 启动不再等待!

问题

item 启动的时候太慢

解决方案

  • 进入 iTerm2 的偏好设置里,在 Profiles 里编辑你的配置,在配置右侧的 General 选项卡里,Command 里选择为 Command,然后里边写入 /usr/bin/login -pfq xxx 其中 xxx 是你的用户名。

配图

MacBook Pro 电源计划

问题

为什么电源选项里面有电源计划,这个有什么用么,如何取消?

解决方案

  • 用途:电源计划可以自动唤醒电脑,但自动唤醒不一定是电源计划造成的。
  • 取消:sudo pmset schedule cancelall

评论加载中