2011-12-23 58 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 
相關問題