无法在OS X 10.9 Mavericks中phpize或配置扩展

don*_*atJ 34 php macos php-extension osx-mavericks

我正在尝试在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
Run Code Online (Sandbox Code Playgroud)

所以我创建了一个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:  
Run Code Online (Sandbox Code Playgroud)

我刚刚安装了zlib并在我的安装时指向./configure. ./configure --with-zlib-dir=/usr/local/Cellar/zlib/1.2.8我收到以下错误消息:

checking for session includes... configure: error: Cannot find php_session.h
Run Code Online (Sandbox Code Playgroud)

所以现在我想知道这里最好的行动方案...... /usr/include/根本不存在......这是小牛队的事吗?我不记得在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做到这一点?我安装了命令行工具......

小智 99

然后运行xcode-select --install以安装XCode5命令行工具sudo pecl install memcache.你应该好好去.


小智 5

安装XCode5命令行工具作为afessler sugest(xcode-select --install)后,我无法执行"sudo pecl install memcache",因为pecl丢失了.我必须按照本指南安装PEAR和PECL:http://techtastico.com/post/como-instalar-pear-y-pecl-en-os-x-mavericks/.然后一切顺利.谢谢!