【问题标题】:PHP Warning: PHP Startup: murmur: Unable to initialize module, compiled with wrong API modulePHP 警告:PHP 启动:杂音:无法初始化模块,使用错误的 API 模块编译
【发布时间】:2018-08-24 22:38:39
【问题描述】:

我正在尝试在 centos 7 上针对 php7 编译自定义 php 扩展。

当我在扩展目录中运行 phpize 时,我得到:

Configuring for:
PHP Api Version:         20160303
Zend Module Api No:      20160303
Zend Extension Api No:   320160303

但是,当我安装模块并运行 php 时,我得到:

PHP Warning:  PHP Startup: murmur: Unable to initialize module
Module compiled with module API=20131226
PHP    compiled with module API=20160303
These options need to match

我已采取的解决问题的步骤:

  • yum 删除 php* -y
  • rm php* 来自 /bin, /usr/bin
  • 已验证系统上不存在其他 phpize 或 php-config

已安装php7:

rpm -Uvh http://rpms.remirepo.net/enterprise/remi-release-7.rpm
yum -y install yum-utils yum-config-manager --enable remi-php71
yum install -y php php-devel php-mbstring php-common php-pear php-pdo php-mysqlnd php-opcache php-intl php-bcmath php-gd php-pecl-amqp php-pecl-mailparse php-xml php-mcrypt php-imap php-ldap php-pecl-memcached php-process php-cli php-pecl-zip

编译自定义扩展:

cd {extension dir}
phpize
./configure --enable-murmur
make

为什么 phpize 会告诉我扩展是针对 PHP Api 版本 20160303 编译的,但是当它被 php 加载时却说模块是针对 Api 版本 20131226 编译的?

【问题讨论】:

  • 我删除了扩展目录中的一些隐藏文件夹,一切都开始运行良好。问题已解决。
  • "make clean" 应该可以解决问题

标签: php centos php-7.1


【解决方案1】:

我在扩展目录中有一些先前编译的文件。一旦我清除了文件,下一个编译在 php 中完美运行。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-08-15
    • 1970-01-01
    • 2012-11-28
    • 1970-01-01
    • 2014-11-17
    • 2012-11-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多