Wordpress安装PHP错误

时间:2014-06-30 12:19:01

标签: php mysql wordpress rhel

这是我运行以下命令php -v

时获得的更新
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/curl.so' - /usr/lib/php/modules/curl.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/dbase.so' - /usr/lib/php/modules/dbase.so: wrong ELF class: ELFCLASS32 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/fileinfo.so' - /usr/lib/php/modules/fileinfo.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/json.so' - /usr/lib/php/modules/json.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mysql.so' - /usr/lib/php/modules/mysql.so: wrong ELF class: ELFCLASS32 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/mysqli.so' - /usr/lib/php/modules/mysqli.so: wrong ELF class: ELFCLASS32 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo.so' - /usr/lib/php/modules/pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_mysql.so' - /usr/lib/php/modules/pdo_mysql.so: wrong ELF class: ELFCLASS32 in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/pdo_sqlite.so' - /usr/lib/php/modules/pdo_sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/phar.so' - /usr/lib/php/modules/phar.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/zip.so' - /usr/lib/php/modules/zip.so: cannot open shared object file: No such file or directory in Unknown on line 0

我试图在RHEL计算机上安装Wordpress。我最初启动并运行mySQL,然后意识到我的PHP是5.1.6版本。我添加了另一个repo,安装了PHP 5.3并删除了旧的php包。

当我打开localhost / wp-admin / install.php时,我在浏览器上遇到的错误是:

  

您的PHP安装似乎缺少MySQL扩展   是WordPress所必需的。

我安装了包php-mysql.x86_64,但我无法弄清问题是什么。 我不知道该怎么做!任何帮助将不胜感激。

感谢。

2 个答案:

答案 0 :(得分:1)

安装所需的 PHP 库。 RHEL安装命令(包含Wordpress所需的所有模块):

sudo yum install php-bcmath  php-cli  php-common  php-devel  php-gd  php-imap  php-mbstring  php-mcrypt  php-mysqlnd  php-odbc  php-pdo  php-pear php-pecl-geoip  php-pecl-jsonc  php-pecl-jsonc-devel  php-pecl-zip  php-pgsql  php-process  php-tidy  php-xml  php-xmlrpc

安装EPEL repos以更新到最新的PHP:

#CentOS 6 64Bit
sudo wget http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
sudo rpm -ivh epel-release-6-8.noarch.rpm
sudo yum update php

其他版本的EPEL repos安装过程 - How to Enable EPEL Repository for RHEL/CentOS 7.x/6.x/5.x

编辑1:

要停用其他存储库,请查看并修改.repo目录中的/etc/yum.repos.d/个文件,并将enabled=1设置为enabled=0。毕竟别忘了跑:

yum clean all 

答案 1 :(得分:0)

所以,我想出来了。安装了最新的php版本。我使用的是64位RHEL,这些库位于/usr/lib64文件夹而不是/usr/lib文件夹中。一旦我在php.ini文件中更改了该位,就会像魅力一样。 :)