我正在尝试在OS X 10.9 Mavericks上构建memcached扩展,以便与内置的PHP 5.4一起使用,最初我尝试了pecl install memcached
,但是出现了以下错误。
checking for zlib location... configure: error: memcached support requires ZLIB. Use --with-zlib-dir=<DIR> to specify the prefix where ZLIB headers and library are located
ERROR: `/private/tmp/pear/install/memcached/configure' failed
于是我创建了一个tmp目录并执行pecl download memcached
,解压代码并cd到适当的目录。
尝试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:
我之前安装了brew zlib并将./configure指向我的安装路径。
./configure --with-zlib-dir=/usr/local/Cellar/zlib/1.2.8
但是出现了以下错误信息:
checking for session includes... configure: error: Cannot find php_session.h
现在我在想这里最好的行动方式是什么... /usr/include/
根本不存在...这是 Mavericks 的问题吗?我完全不记得在 10.8 中遇到过这个问题。
我可以尝试使用 brew 安装 php-devel
,但我认为那不会是我需要的正确版本?任何帮助都将非常感激。
更新
locate php_session.h
显示
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/usr/include/php/ext/session/php_session.h
我应该只是将此链接 ln -s
到预期位置,还是有一些通过 XCode 完成它的方法?我已经安装了命令行工具...
php-protocolbuffers
,但是出现了php.h
找不到的错误。xcode-select
已经存在。 - Volatil3