在Mac下执行 sudo 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

解决方法:

macOS系统在10.12版本之上要先做前三步,否则从第四步开始

1.重启mac电脑,同时按住command+r,等出现进度条了再松开

2.弹出界面的工具条,选择“实用工具”,再选择“终端”,输入:csrutil disable,然后回车。会有英文提示成功

3.重新启动电脑

4.进入“终端”,输入

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

要是找不到Xcode.app,先到App Store下载安装Xcode

特别提醒:

有设置过csrutil disable这个,/usr/lib/php/extensions/no-debug-non-zts-20191028  这个文件将可以写入,不然默认是被系统保护着,即使root权限也改不了。有用到的扩展都可以放在这个文件里面

参考链接:https://blog.csdn.net/johnson262019986/article/details/88552439

mac安装扩展出现grep: /usr/include/php/main/php.h的更多相关文章

  1. grep: /usr/include/php/main/php.h: No such file or directory

    异常 grep: /usr/include/php/main/php.h: No such file or directory grep: /usr/include/php/Zend/zend_mod ...

  2. Mac OS找不到/usr/include文件夹的解决办法

    Mojave最新解决方案:终端执行: xcode-select --install #完成后执行 sudo installer -pkg /Library/Developer/CommandLineT ...

  3. Mac安装Mysql-python _mysql.c:44:10: fatal error: 'my_config.h' file not found

    解决步骤 brew install mysql brew unlink mysql brew install mysql-connector-c sed -i -e /bin/mysql_config ...

  4. Mac安装php扩展redis遇到的问题,执行phpize问题

    1.安装redis在mac OS中可以使用brew命令进行安装redis:mac OS使用brew命令安装软件安装命令:brew install redis因为我已经安装过了,这里就不在赘述.安装完之 ...

  5. mac 安装phpredis扩展

    curl -O https://nodeload.github.com/nicolasff/phpredis/zip/master tar -zxf master cd phpredis-master ...

  6. 升级mac中的系统之后,给PHP安装扩展常出现问题

    (1)在装mcrypt插件时报错,提示:mcrypt fatal error: 'php.h' file not found,然后又仔细操作了一次在输完phpize回车时就已经开始出错了,出错信息如下 ...

  7. PHP 安装扩展 phpize

    报错 执行 phpize 时, 报如下错误: grep: /usr/include/php/main/php.h: No such file or directory grep: /usr/inclu ...

  8. php安装扩展的几种方法

    转自:http://doc3.workerman.net/appendices/install-extension.html 安装扩展 注意 与Apache+PHP或者Nginx+PHP的运行模式不同 ...

  9. /usr/include/glib-2.0/glib/gtypes.h:34:24: fatal error: glibconfig.h: No such file or directory

    cc -DDEBUG -mtune=core2 -O2 \ -onvideo nvideo.c \ -I/usr/include/atk-1.0 \ -I/usr/include/cairo \ -I ...

随机推荐

  1. 关于数据库中的三值逻辑(Tree-Value-Logic)

    在sql中,逻辑表达式(也叫做谓词),可以有三种值:True.False.Unknown,这就是所谓的三值逻辑,,是sql的特有属性. 在大多数编程语言中,逻辑表达式只有两个值,就是True和Fals ...

  2. 扒网站工具 HTTrack Website Copier

    下载地址:http://www.pc6.com/softview/SoftView_30936.html 作者:匿名用户 链接:https://www.zhihu.com/question/34188 ...

  3. python字典操作方法详解

    前言 字典是一种通过名字或者关键字引用的得数据结构,key 类型需要时被哈希,其键可以是数字.字符串.元组,这种结构类型也称之为映射.字典类型是Python中唯一內建的映射类型. 注意,浮点数比较很不 ...

  4. win10+anaconda安装tensorflow和keras遇到的坑小结

    win10下利用anaconda安装tensorflow和keras的教程都大同小异(针对CPU版本,我的gpu是1050TI的MAX-Q,不知为啥一直没安装成功),下面简单说下步骤. 一 Anaco ...

  5. 【转】CGI 和 FastCGI 协议的运行原理

    介绍 深入CGI协议 CGI的运行原理 CGI协议的缺陷 深入FastCGI协议 FastCGI协议运行原理 为什么是 FastCGI 而非 CGI 协议 CGI 与 FastCGI 架构 再看 Fa ...

  6. python爬虫(二) urlparse和urlsplit函数

    urlparse和urlsplit函数: urlparse: url='http://www.baidu.com/s?wd=python&username=abc#1' result=pars ...

  7. c++中的Exceptions异常处理(翁恺c++公开课[36])

    Exceptions用于处理Run-time Error: //文件读取的异常捕获伪代码 try{ open the file; determine its size; allocate that m ...

  8. C++启动和关闭外部exe

    转载:https://www.cnblogs.com/Sketch-liu/p/7277130.html 1.WinExec(  lpCmdLine: LPCSTR; {文件名和参数; 如没指定路径会 ...

  9. 实现JSP部分内容继承

    我们的网站框架搭好以后,只需要主体部分显示不同的数据. 如果每次代码重写都会造成冗余. 今天欣赏别人代码,学到了 maven 核心代码 <dependency> <groupId&g ...

  10. ubuntu14 安装Sublime Text 3

    Step1 从官网下载Sublime Text3 安装包 sublime_text_3_build_3176_x64.tar.bz2,如果有网络问题,请挂VPN或者从其他地方下载. 拷贝至/home/ ...