MAMP安装yaf教程 遇到的坑

配合地址:https://www.jianshu.com/p/dc719ae74f97

1、http://pecl.php.net/package/yaf

    下载对应yaf的扩展(PHP版本是5.6.30,下载的Yaf是yaf-2.3.5)

    放到目录/Applications/MAMP/bin/php/php5.6.30/include/php

2、运行:/usr/bin/phpize

或者运行(不会有以下错误):/Applications/MAMP/bin/php/php5.6.30/bin/phpize

    提示错误1:

        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

    解决办法1(注意:MacOSX10.14.sdk根据系统版本)

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

    提示错误2(m4版本过低):

        Configuring for:

        PHP Api Version:

        Zend Module Api No:

        Zend Extension Api No:

        autom4te: need GNU m4 1.4 or later: /usr/bin/m4

    解决办法2:

        卸载m4:brew uninstall m4

        安装m4:brew install m4

        修改配置文件:在/usr/local/bin/下面有一个autom4te,这个文件里面第91行,给变量m4赋值了一个地址,原来的是/usr/local/bin/m4,改成/usr/local/Cellar/m4/1.4.18/bin/m4

3、运行:./configure --with-php-config=/Applications/MAMP/bin/php/php5.6.30/bin/php-config

    错误提示3:

        checking for grep that handles long lines and -e... /usr/bin/grep

        checking for egrep... /usr/bin/grep -E

        checking for a sed that does not truncate output... /usr/bin/sed

        checking for cc... cc

        checking whether the C compiler works... no

        configure: error: in `/Applications/MAMP/bin/php/php5.6.30/include/php/yaf-2.3.5/yaf-2.3.5':

        configure: error: C compiler cannot create executables

        See `config.log' for more details.

    解决办法3

        这个错误提示你要去 config.log 查看具体错误信息

        我的错误提示是:xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun

        解决办法:安装xcrun,在终端输入:xcode-select --install

4、运行:make

5、成功安装后

4、复制yaf.so 到 /Applications/MAMP/bin/php/php5.6.30/lib/php/extensions/no-debug-non-zts-20131226目录

你可能感兴趣的:(MAMP安装yaf教程 遇到的坑)