gpt4 book ai didi

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

转载 作者:IT王子 更新时间:2023-10-29 01:03:19 26 4
gpt4 key购买 nike

我正在尝试在 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'd 到适当的目录。

尝试 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 但我认为这不会是我需要的正确版本?任何帮助将不胜感激

更新

定位 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 做到这一点?我已经安装了命令行工具...

最佳答案

运行 xcode-select --install 来安装 XCode5 命令行工具,然后 sudo pecl install memcache。你应该很高兴。

关于php - 无法在 OS X 10.9 Mavericks 中 phpize 或配置扩展,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19531262/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com