Php

在 CentOS 5.4 上更新 PHP 後出現“無法初始化模組”警告

  • December 8, 2012

將 PHP 從 5.1x 升級到 5.2.10 後,出現以下警告php -v

[root@localhost ~]# 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

我該如何解決?謝謝!

您需要刪除舊模組並安裝新模組。如果您通過 yum/rpm 安裝,則更新軟體包。如果您自己建構了 PHP,那麼您還需要使用這些擴展來建構它。

即使memcached在伺服器上愉快地執行,它也不能在沒有 PECL 擴展的情況下從 PHP 訪問。幸運的是,這是一個非常簡單的過程;只需使用pecl命令:

$ pecl install memcache

見:http ://www.lullabot.com/articles/installing-memcached-redhat-or-centos

引用自:https://serverfault.com/questions/154715