我有一台全新的服务器,正在尝试设置它。这是一台 64 位机器,我无法安装“fileinfo”或“memcache”。我已卸载它们并使用 yum 和 pecl 重新安装它们,但没有成功。Yum 安装正常“无错误”,但运行 php 时出现错误。据我所知,pecl 仅安装 32 位。没有将任何东西放入 lib64 目录中。这是我的输出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: 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 5.2.14 (cli) (built: Aug 12 2010 16:03:48)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
以下是一些其他系统信息,以防您需要
名称:
Linux server.actham.us 2.6.18-194.26.1.el5 #1 SMP Tue Nov 9 12:54:20 EST 2010 x86_64 x86_64 x86_64 GNU/Linux
php-m:
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: 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 Modules]
bz2
calendar
ctype
curl
date
dbase
dom
exif
filter
ftp
gd
gettext
gmp
hash
iconv
imap
json
ldap
libxml
mbstring
mcrypt
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
readline
Reflection
session
shmop
SimpleXML
sockets
SPL
standard
tokenizer
wddx
xml
xmlreader
xmlrpc
xmlwriter
xsl
zip
zlib
[Zend Modules]
任何帮助都将不胜感激,谢谢......
答案1
好吧,既然没有反馈,我就发布我使用的方法。如果你使用的是 Red Hat/CentOS,那么我使用电力供应处和IUS 社区项目包。
#EPEL
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-1-1.ius.el5.noarch.rpm
#IUS Community Project
wget http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-6.ius.el5.noarch.rpm
#Install repos
rpm -Uvh epel-release-1-1.ius.el5.noarch.rpm ius-release-1.0-6.ius.el5.noarch.rpm
PHP 软件包以 php52 或 php53 为前缀(如果您需要其中任何一个)。还有 APC 和 Fileinfo 软件包。如果可以,您应该使用 PHP 5.3,Fileinfo 已捆绑在其中。安装带有 APC 的基本 PHP 很简单:
yum install php53-pecl-apc
如果您需要安装其他模块,如 PDO、suhosin、soap 等,请查看其他模块:
yum list php53*