2011-12-23 48 views
1

在CentOS 5.4上启动并运行PHP 5.3的最佳方式是什么? 我的机器说我已安装PHP 5.3,但遇到与我的脚本说 致命错误:在'/ var /在RedbeanPHP 3.0 lib中新建一个PDO类。在CentOS 5.4上运行PHP 5.3 - 致命错误未找到类'PDO'

我该如何解决这个丢失的PDO问题?

我试图按照这些指示: 从http://www.computingunplugged.com/issues/issue201102/00002619002

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm 
rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-4.noarch.rpm 
# THIS LINE FAILED FOR ME 
rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-6.ius.el5.noarch.rpm 

yum erase php php-pear php-mysql php-cli php-common 

yum install php53u php53u-pear php53u-cli php53u-common php53u-gd 
yum install php53u-mbstring php53u-mcrypt php53u-mysql php53u-soap 
yum install php53u-xml php53u-xmlrpc php53u-bcmath 

UPDATE
有人消除了他们的答案。这很好。我正准备把它放回去,具体步骤。 首先,我不得不百胜安装php53u-devel的
引述“
你需要PDO扩展,通常安装扩展的最好方式是通过PECL。

之前,你可以安装任何PECL扩展您需要安装的php5-dev软件包

sudo pecl install pdo
sudo pecl install pdo_mysql
You then need add the following to the end of your php.ini file(s). Depending on which version of PHP you installed they’ll be /etc/php5/apache2/php.ini, /etc/php5/cgi/php.ini and /etc/php/cli/php.ini.

延长= pdo.so
延长= pdo_mysql.so

现在试图运行sudo pecl install pdo_mysql
时,我得到一个mysql_query_missing,但不知道如何克服这个问题。

+0

我在哪里可以得到php5-dev包?我需要添加什么回购? – BuddyJoe 2011-12-23 17:35:04

回答

2

您还必须安装php-pdo软件包。

编辑:也许这会有所帮助,以及:How do I enable PDO using CentOS?

+0

我能够安装 - yum安装php53u-devel – BuddyJoe 2011-12-23 17:40:01

+0

@brunot你想告诉我什么? – TimWolla 2011-12-23 17:41:36

+0

最后...我已经有了.so文件我想我只是在我的问题中列出的所有其他步骤之后添加了php ini设置。 – BuddyJoe 2011-12-23 18:07:01

1

我已经能够成功地在CentOS 5.4 Linux上安装PHP-5.3。我需要这个能够成功安装并运行Drupal 7 - 这也为我解决了问题。下面是详细信息:

这是我在ServerFault写了答案的副本:https://serverfault.com/a/392168/29205

(...我的问题:https://serverfault.com/questions/391772/php-xml-install-complains-of-dependency-php-common-but-this-is-already-installed/392168#392168

该解决方案是基于公认的答案:

https://serverfault.com/questions/391839/how-to-force-centos-yum-to-use-a-later-version-of-a-package-dependency-already-i

总结:移动到PHP5.3。

原因:支持php5.2因为其他问题接受的答案中解释的安全问题而被删除。此删除会导致版本的依赖关系不匹配,从而导致发生错误。

背景

我想一个CentOS 5.4的机器上运行的Drupal 7。所以我需要5.3版本的PHP。

以下是升级到PHP 5的完整工作步骤。3与工作存储库截至2012年5月24日(我提供评论前## - 你不需要这些,只为您的信息)

# Comment: sites like http://www.computingunplugged.com/issues/issue201102/00002619001 
# provide a good start for remedying the problem whereby we need 5.3 on CentOS 5.4 to run Drupal 7. But although their packages worked at the time, the links are now outdated, and updates to these are below. 


# comment: (as of May 2012 - the following work, the reason for failures was use of 1) older packages no longer on the server and 2) change of address of one of the servers to dl.fedoraproject.org/pub/epel (credit to: http://osdir.com/ml/centos/2012-03/msg00057.html) 

rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm 
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm 
rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/i386/ius-release-1.0-10.ius.el5.noarch.rpm 

yum erase php php-pear php-mysql php-cli php-common 

yum install php53u php53u-pear php53u-cli php53u-common php53u-gd 
yum install php53u-mbstring php53u-mcrypt php53u-mysql php53u-soap 
yum install php53u-xml php53u-xmlrpc php53u-bcmath 


# After doing the above, php -v shows 5.3.x But on attempting to install Drupal 7 you may get complaint of something "Your PHP installation is too old 5.1.6 Drupal requires at least PHP 5.2.4. See the system requirements page for more information." and php.info shows the same 

# The remedy is to simply restart your apache server 

service httpd restart 

# credit to following for suggesting service httpd restart :- 
# https://serverfault.com/a/207806/29205 
# https://serverfault.com/questions/207762/centos-updating-php-via-yum-doesnt-change-the-version-apache-uses 

# Drupal 7 install on CentOS 5.4 worked after applying the above steps 

# If your MySQL server is not running (check by ps -ef | grep mysql) then you can run: 

/etc/init.d/mysqld 

# ...to start it, and to make sure it starts when the machine is restarted or cold booted: 

chkconfig mysqld on 
相关问题