SLES11 上的 2 个不同版本的 PHP

Posted

技术标签:

【中文标题】SLES11 上的 2 个不同版本的 PHP【英文标题】:2 different versions of PHP on SLES11 【发布时间】:2016-05-20 08:59:00 【问题描述】:

我目前正在使用安装了 apache 网络服务器的 SLES11 系统来托管 WordPress 网站。

要在 WordPress 中集成 LDAP 身份验证插件,CMS 需要 php curl 模块。

我想知道插件告诉我,这不可用,因为我通过 php5 的默认存储库安装了它。 经过一番调查,我发现 Web 服务器已配置为使用 php-cgi,它是 php 5.5.16。 SUSE repo 中的默认 php5 是 5.3.17。

所以我检查了模块并看到了这个:

对于 php-cgi:

mgr@server:/etc> php-cgi -m
PHP Warning:  PHP Startup: curl: Unable to initialize module
Module compiled with module API=20090626
PHP    compiled with module API=20121212
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: dom: Unable to initialize module
Module compiled with module API=20090626
PHP    compiled with module API=20121212
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php5/extensions/pdo.so' - /usr/lib64/php5/extensions/pdo.so: undefined symbol: zval_property_ctor in Unknown on line 0
PHP Warning:  PHP Startup: pdo_sqlite: Unable to initialize module
Module compiled with module API=20090626
PHP    compiled with module API=20121212
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php5/extensions/sqlite.so' - /usr/lib64/php5/extensions/sqlite.so: undefined symbol: zval_property_ctor in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php5/extensions/sqlite3.so' - /usr/lib64/php5/extensions/sqlite3.so: undefined symbol: zval_property_ctor in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php5/extensions/xmlreader.so' - /usr/lib64/php5/extensions/xmlreader.so: undefined symbol: zval_property_ctor in Unknown on line 0
PHP Warning:  PHP Startup: xmlrpc: Unable to initialize module
Module compiled with module API=20090626
PHP    compiled with module API=20121212
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php5/extensions/xmlwriter.so' - /usr/lib64/php5/extensions/xmlwriter.so: undefined symbol: zval_property_ctor in Unknown on line 0
PHP Warning:  Cannot load module 'pdo_mysql' because required module 'pdo' is not loaded in Unknown on line 0
[PHP Modules]
cgi-fcgi
Core
ctype
date
ereg
filter
gd
hash
iconv
json
ldap
libxml
mbstring
mcrypt
mhash
mysql
mysqli
mysqlnd
openssl
pcre
Reflection
session
SimpleXML
SPL
standard
suhosin
tokenizer
xml
zlib

[Zend Modules]

对于 php:

mgr@server:/etc> php -m
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php5/extensions/php_curl.dll' - /usr/lib64/php5/extensions/php_curl.dll: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: ctype: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: gd: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: iconv: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php5/extensions/json.so' - /usr/lib64/php5/extensions/json.so: undefined symbol: zend_new_interned_string in Unknown on line 0
PHP Warning:  PHP Startup: ldap: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: mbstring: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: mcrypt: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: mysql: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php5/extensions/mysqli.so' - /usr/lib64/php5/extensions/mysqli.so: undefined symbol: zend_new_interned_string in Unknown on line 0
PHP Warning:  PHP Startup: openssl: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: pdo_mysql: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib64/php5/extensions/suhosin.so' - /usr/lib64/php5/extensions/suhosin.so: undefined symbol: zend_execute_ex in Unknown on line 0
PHP Warning:  PHP Startup: tokenizer: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
PHP Warning:  PHP Startup: zlib: Unable to initialize module
Module compiled with module API=20121212
PHP    compiled with module API=20090626
These options need to match
 in Unknown on line 0
[PHP Modules]
Core
curl
date
dom
ereg
filter
hash
libxml
mhash
mysqlnd
pcre
PDO
pdo_sqlite
Reflection
session
SimpleXML
SPL
SQLite
sqlite3
standard
xml
xmlreader
xmlrpc
xmlwriter

[Zend Modules]

所以我的问题是: 1. 如何解决模块未初始化的问题? 2. 如何更改 apache web 服务器以使用 /usr/bin/php 而不是 /usr/bin/php-cgi 中的 php-cgi? 3. 或者谁能解释一下,如何安装 php-cgi 的模块?

谢谢

最好的问候 安迪

【问题讨论】:

【参考方案1】:

您最好请系统管理员为您执行此操作。因为它可能很复杂。他应该禁用 php 作为 FastCgi(在 Web 服务器 Apache 配置 LoadModule mod_fastcgi /.../.so 中查找并删除或注释)并启用它(添加 LoadModule php5_module /path/to/lib/apache2/modules/libphp5.so)作为网络服务器的模块。

【讨论】:

以上是关于SLES11 上的 2 个不同版本的 PHP的主要内容,如果未能解决你的问题,请参考以下文章

Linux学习

常见的Linux发行版本及不同发行版本之间的联系和区别

MAGE45期第一周

MAGE45期第一周

Linux版本及历史帮助简单操作

VS 2010 Beta 2有几个版本?都有啥不同?