Deprecated: Optional parameter $keys declared before required parameter $cms_id is implicitly treated as a required parameter in /home/www/dev/work/class/blog/CmsKey.php on line 75

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\main::$outlink is deprecated in /home/www/dev/work/website/lvesu/template/blog/cms/cms.tpl on line 2

Deprecated: Creation of dynamic property lvesu\lvesu\controller\blog\main::$status is deprecated in /home/www/dev/work/website/lvesu/template/blog/index.head.php on line 2
fatal error: 'php.h' file not found 错误的解决办法 - 互联网笔记

略微加速

略速 - 互联网笔记

fatal error: 'php.h' file not found 错误的解决办法

2020-04-10 leiting (6405阅读)

标签 Mac OS PHP

今天在MAC下安装Swoole扩展的时候(https://github.com/swoole/swoole-src),提示

In file included from /Users/sxf/Downloads/swoole-src/swoole.c:19:
./php_swoole.h:22:10: fatal error: 'php.h' file not found
#include "php.h"
^
1 error generated.
make: *** [swoole.lo] Error 1

错误。解决办法如下:

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

这里注意一下,你使用的系统版本号。

*注意MacOSX10.10.sdk修改为自己系统的版本号*

另外也有可能遇到提示 pcre.h 找不到,直接安装一下即可 brew install pcre,参考: http://blog.csdn.net/rsp19801226/article/details/44590803


没安装xcode的先从商店安装xcode


北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3