php - PEAR 声称 php 是用旧模块编译的

标签 php xdebug pear pecl

我刚刚升级到 php 5.6.4。当我对各种软件包进行 pear 安装时,它会提示模块不匹配。

示例:

sudo pecl install xdebug
Failed loading /usr/local/php-5.6.4/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so:
/usr/local/php-5.6.4/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so: undefined symbol: zend_execute_ex
Zend OPcache requires Zend Engine API version 220131226.
The Zend Engine API version 220100525 which is installed, is outdated.

PHP Warning:  PHP Startup: PDFlib: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20100525

但是,我相信20131226是php 5.6.4,20100525是5.4。奇怪的是,pear 认为模块是用 5.6 编译的,但 php 的版本是 5.4。我也遇到过这种情况,模块比 php 版本旧很多,通常只是重新编译这些模块。这个我有点难住了。

[richv]$ php -v
PHP 5.6.4 (cli) (built: Jun 16 2015 16:08:30)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2014 Zend Technologies
    with Xdebug v2.3.2, Copyright (c) 2002-2015, by Derick Rethans
    with Zend OPcache v7.0.4-dev, Copyright (c) 1999-2014, by Zend Technologies

[richv]$ pear version
PEAR Version: 1.9.5
PHP Version: 5.6.4
Zend Engine Version: 2.6.0
Running on: Linux dragon 3.10.0-229.4.2.el7.x86_64 #1 SMP Wed May 13 10:06:09 UTC 2015 x86_64

最佳答案

如果您仍然保留着旧的 php 版本,那么 pear/pecl 可能仍然使用这个 php 版本 - 即使它在 pear 版本 中显示正确的 php 版本。

尝试更改 php_bin pear 配置设置:

$ pear config-show
..
$ pear config-set php_bin /path/to/new/php

关于php - PEAR 声称 php 是用旧模块编译的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30898553/

相关文章:

php - 在您的开发环境中组织 PHP 包含

php - 在浏览器中将 xml 作为字符串打印,而不是使用 asXml() 方法

docker - Xdebug:在将IDE最小化几分钟后,脚本恢复在后台自动运行

PHP Pear Mail SSL 连接问题

php - 使用 PEAR 处理数据库。向用户显示的数据库错误。如何停止?

php - AJAX 够用吗?我应该学习 PHP 框架吗?

phpstorm - Xdebug 与 PhpStorm 在 CLI 中工作正常,而不是在浏览器中工作

php - 为 PHP 配置 Notepad++ DBGP 插件和 XDebug

php - 如何忽略行长 PHP_CodeSniffer

php - 激活/停用选择框选项的 spry 验证