首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PHP警告: PHP启动:?:无法初始化模块

PHP警告: PHP启动:?:无法初始化模块
EN

Stack Overflow用户
提问于 2010-06-28 16:15:24
回答 9查看 133.8K关注 0票数 19

在将php从5.1升级到5.2.10之后,我在php -v时收到了以下警告

代码语言:javascript
复制
    # php -v
    PHP Warning:  PHP Startup: fileinfo: Unable to initialize module
    Module compiled with module API=20050922, debug=0, thread-safety=0
    PHP    compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
     in Unknown on line 0
    PHP Warning:  PHP Startup: mcrypt: Unable to initialize module
    Module compiled with module API=20050922, debug=0, thread-safety=0
    PHP    compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
     in Unknown on line 0
    PHP Warning:  PHP Startup: memcache: Unable to initialize module
    Module compiled with module API=20050922, debug=0, thread-safety=0
    PHP    compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
     in Unknown on line 0
    PHP Warning:  PHP Startup: mhash: Unable to initialize module
    Module compiled with module API=20050922, debug=0, thread-safety=0
    PHP    compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
     in Unknown on line 0
    PHP Warning:  PHP Startup: mssql: Unable to initialize module
    Module compiled with module API=20050922, debug=0, thread-safety=0
    PHP    compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
     in Unknown on line 0
    PHP Warning:  PHP Startup: readline: Unable to initialize module
    Module compiled with module API=20050922, debug=0, thread-safety=0
    PHP    compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
     in Unknown on line 0
    PHP Warning:  PHP Startup: tidy: Unable to initialize module
    Module compiled with module API=20050922, debug=0, thread-safety=0
    PHP    compiled with module API=20060613, debug=0, thread-safety=0
    These options need to match
     in Unknown on line 0
    PHP 5.2.10 (cli) (built: Nov 13 2009 11:24:03)
    Copyright (c) 1997-2009 The PHP Group
    Zend Engine v2.2.0, Copyright (c) 1998-2009 Zend Technologies

我怎么才能修复它?谢谢!

EN

回答 9

Stack Overflow用户

发布于 2010-06-28 16:54:18

看起来你还没有升级PHP模块,它们不兼容。

检查php.ini中的extension_dir指令。它应该指向包含5.2模块的文件夹。

创建并打开一个phpinfo文件,然后搜索extension_dir以查找路径。

因为您已经升级了,所以有可能您使用的是指向5.1模块的旧php.ini

票数 21
EN

Stack Overflow用户

发布于 2011-11-11 18:19:55

尝试使用pecl命令升级其中的每个模块

代码语言:javascript
复制
# pecl upgrade fileinfo
# pecl upgrade memcache
# pecl upgrade mhash
# pecl upgrade readline

等等。

票数 13
EN

Stack Overflow用户

发布于 2015-09-05 22:26:44

brew reinstall php56-mcrypt --build-from-source

为每个需要用相同版本编译的模块传递--build-from-source标志。

它还可能需要PHP选项,这取决于您的插件。如果是这样的话,brew reinstall php56 --with-thread-safety

要查看phpversion的所有选项,请运行brew options php56 (将56替换为您的版本)

票数 10
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/3130910

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档