2

I need to install a couple of PHP extensions, like memcache and geoip, on MAMP 3.5, for PHP 5.6.10.

What I'm doing is to run phpize:

/Applications/MAMP/bin/php/php5.6.10/bin/phpize

Which outputs:

Configuring for:

PHP Api Version: 20131106

Zend Module Api No: 20131226

Zend Extension Api No: 220131226

Then configure:

/configure --with-php-config=/Applications/MAMP/bin/php/php5.6.10/bin/php-config

And, afterwards, try to build with make. This is where I get this error:

/Applications/MAMP/bin/php/php5.6.10/include/php/Zend/zend.h:51:11: fatal error: 'zend_config.h' file not found

I downloaded the content of the include/php folder from php.net, version 5.6.10 (found here).

I feel I'm closer now to solving this problem, but I'm at loss with this error. What am I doing wrong, so that apparently the freshly downloaded php from php.net is missing files?

Thank you.

4

1 回答 1

4

我最终使用 pecl 而不是手动编译扩展。

make 步骤中缺少的标题是我没有在 php 文件夹上运行 ./configure - 我真的偶然遇到了这一步。

之后,我所要做的就是运行:

sudo /Applications/MAMP/bin/php/php5.6.10/bin/pecl install memcache

一切都在轮子上运行。

在尝试 pecl 之前,我尝试像在帖子中那样运行 make,并且扩展编译成功,但是 php 和扩展之间的版本不匹配。我以前尝试过 pecl 没有成功,但我真的不知道自上次尝试以来我的配置发生了什么变化。


无论如何,我写了一个要点,包括我所有的步骤来完成这个工作,以防有人遇到同样的问题并且像我一样是这个主题的完整初学者。

于 2015-12-17T17:59:33.803 回答