以前 php 版本的 pecl 安装为什么这是一个问题?
2022-08-30 15:49:13
我已经将MacBook升级到了Mavericks,并破坏了我的开发环境。我现在遇到的问题是,我的pear/pecl仍然试图为我以前的(5.3)版本的PHP而不是版本5.4安装。
PHP 版本:
$ php -v
PHP 5.4.17 (cli) (built: Aug 25 2013 02:03:38)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
梨
$ pear version
PEAR Version: 1.9.4
PHP Version: 5.4.17
Zend Engine Version: 2.4.0
Running on: Darwin MBP-retina.local 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
如果我安装 apc 与
$ sudo pecl install apc
downloading APC-3.1.13.tgz ...
Starting to download APC-3.1.13.tgz (171,591 bytes)
.....................................done: 171,591 bytes
55 source files, building
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
...
Build process completed successfully
Installing '/usr/local/Cellar/php53/5.3.26/include/php/ext/apc/apc_serializer.h'
Installing '/usr/local/Cellar/php53/5.3.26/lib/php/extensions/no-debug-non-zts-20090626/apc.so'
install ok: channel://pecl.php.net/APC-3.1.13
Extension apc enabled in php.ini
并启用我的php中的apc模块.ini php -v更改为:
$ php -v
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/extensions/no-debug-non-zts-20100525/apc.so' - dlopen(/usr/lib/php/extensions/no-debug-non-zts-20100525/apc.so, 9): image not found in Unknown on line 0
PHP 5.4.17 (cli) (built: Aug 25 2013 02:03:38)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
所以 pecl 在 中安装我的 apc 扩展,php 期望它在 ./usr/local/Cellar/php53/5.3.26/lib/php/extensions/no-debug-non-zts-20090626
/usr/lib/php/extensions/no-debug-non-zts-20100525/
简单地创建符号链接会给出以下错误:
$ php -v
PHP Warning: PHP Startup: apc: 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.17 (cli) (built: Aug 25 2013 02:03:38)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies
with Xdebug v2.2.3, Copyright (c) 2002-2013, by Derick Rethans
所以这不是一个解决方案。
任何人都可以给我指出正确的方向吗?我真的不知道这是怎么回事。