phpize和PHPAPI版本不匹配
我正试图在我的mac电脑中安装phpize和PHPAPI版本不匹配,php,memcached,php-extension,Php,Memcached,Php Extension,我正试图在我的mac电脑中安装memcached。我已经下载并安装了它。我也将其添加到php.ini中。但仍memcached未加载。我意识到问题在于php和phpize的API版本不匹配 这就是我做php-v PHP Warning: PHP Startup: memcached: Unable to initialize module Module compiled with module API=20090626 PHP compiled with module API=20100
memcached
。我已经下载并安装了它。我也将其添加到php.ini中。但仍memcached
未加载。我意识到问题在于php
和phpize
的API版本不匹配
这就是我做php-v
PHP Warning: PHP Startup: memcached: Unable to initialize module
Module compiled with module API=20090626
PHP compiled with module API=20100525
These options need to match
in Unknown on line 0
PHP 5.4.8 (cli) (built: Oct 30 2012 19:29:58)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2012 Zend Technologies
如果有人能帮我解决这个问题,我将不胜感激。干杯。您需要手动构建PHP扩展。您最终使用的扩展是根据系统的PHP5.3副本构建的,而不是您自己安装的PHP5.4。根据您的PHP版本下载phpX.X.tgz,解压缩并将文件PHP.z、zend_modules.h、zend_extension.h复制到include目录(如果编辑文件并搜索define api_version,则可以检查正确的api版本。它必须与phpinfo显示的api编号匹配)
换句话说,当您构建扩展时,您必须包含正确的.h文件,该文件可以从phpxx.tgz源获取是的,您应该通过以下步骤手动构建扩展
phpize
./configure --with-php-config=/usr/local/php/bin/php-config
make
make install
确保运行的phpize
和php config
指向正确的php验证
不在/usr/bin/phpize
和/usr/include/php
请确保使用
--with php config
如何安装php和memcached?您使用的是软件包管理器吗?我手动编译了php。但使用brew安装memcached我也尝试过手动安装。请您指点我正确的方向。请确保运行insta的phpize
副本用PHP5.4填充,而不是/usr/bin/phpize
。当我执行{which PHP}时,它会显示/usr/bin/PHP和{which phpize}返回/usr/bin/PHP。所以我假设它们都是对的。不是吗?不。这些路径都指向系统PHP(5.3)。我已经更新了我的两个php。它们都是5.4.8。这是phpize-v配置:php Api版本:20090626 Zend模块Api编号:20090626 Zend扩展Api编号:220090626
非常感谢您的——带有php配置的提示!!有没有文档可以让我们知道哪些参数可以传递给/c配置
?