環境 CentOS 5.5 i386

當我yum install php53時,出現了如下訊息

# yum install php53
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* addons: mirror01.idc.hinet.net
* base: mirror01.idc.hinet.net
* extras: mirror01.idc.hinet.net
* updates: mirror01.idc.hinet.net
Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package php53.i386 0:5.3.3-1.el5_6.1 set to be updated
–> Processing Dependency: php53-cli = 5.3.3-1.el5_6.1 for package: php53
–> Processing Dependency: php53-common = 5.3.3-1.el5_6.1 for package: php53
–> Running transaction check
—> Package php53-cli.i386 0:5.3.3-1.el5_6.1 set to be updated
—> Package php53-common.i386 0:5.3.3-1.el5_6.1 set to be updated
–> Processing Conflict: php53-common conflicts php-common
–> Finished Dependency Resolution
php53-common-5.3.3-1.el5_6.1.i386 from updates has depsolving problems
–> php53-common conflicts with php-common
Error: php53-common conflicts with php-common
You could try using –skip-broken to work around the problem
You could try running: package-cleanup –problems
package-cleanup –dupes
rpm -Va –nofiles –nodigest

我試了以下三個指令 (要安裝yum install yum-utils才會有package-cleanup)
# package-cleanup –problems

Setting up yum
Reading local RPM database
Processing all local requires
No problems found

# package-cleanup –dupes

Setting up yum

# rpm -Va –nofiles –nodigest

好像沒什麼效果

我試了
# yum –skip-broken install php53

Setting up Install Process
Resolving Dependencies
–> Running transaction check
—> Package php53.i386 0:5.3.3-1.el5_6.1 set to be updated
–> Processing Dependency: php53-cli = 5.3.3-1.el5_6.1 for package: php53
–> Processing Dependency: php53-common = 5.3.3-1.el5_6.1 for package: php53
–> Running transaction check
—> Package php53-cli.i386 0:5.3.3-1.el5_6.1 set to be updated
—> Package php53-common.i386 0:5.3.3-1.el5_6.1 set to be updated
–> Processing Conflict: php53-common conflicts php-common
–> Finished Dependency Resolution
php53-common-5.3.3-1.el5_6.1.i386 from updates has depsolving problems
–> php53-common conflicts with php-common
–> Running transaction check
—> Package php53-common.i386 0:5.3.3-1.el5_6.1 set to be updated
–> Processing Dependency: php53-common = 5.3.3-1.el5_6.1 for package: php53
–> Processing Dependency: php53-common = 5.3.3-1.el5_6.1 for package: php53-cli
–> Finished Dependency Resolution
php53-cli-5.3.3-1.el5_6.1.i386 from updates has depsolving problems
–> Missing Dependency: php53-common = 5.3.3-1.el5_6.1 is needed by package php53-cli-5.3.3-1.el5_6.1.i386 (updates)
php53-5.3.3-1.el5_6.1.i386 from updates has depsolving problems
–> Missing Dependency: php53-common = 5.3.3-1.el5_6.1 is needed by package php53-5.3.3-1.el5_6.1.i386 (updates)

Packages skipped because of dependency problems:
php53-5.3.3-1.el5_6.1.i386 from updates
php53-cli-5.3.3-1.el5_6.1.i386 from updates
php53-common-5.3.3-1.el5_6.1.i386 from updates

只好這麼作

rpm -qa|grep php 找出所有php的套件

然後用–nodeps

rpm -e –nodeps php5-ioncube-loader-3.1-07051711 php-5.1.6-27.el5_5.3 php-imap-5.1.6-27.el5_5.3 php-mbstring-5.1.6-27.el5_5.3 php-devel-5.1.6-27.el5_5.3 php-common-5.1.6-27.el5_5.3 php-cli-5.1.6-27.el5_5.3 php-xml-5.1.6-27.el5_5.3 php-mysql-5.1.6-27.el5_5.3 php-sqlite2-5.1.6-200705230938 php-pdo-5.1.6-27.el5_5.3 php-gd-5.1.6-27.el5_5.3

再安裝

yum install php53-ioncube-loader php53 php53-imap php53-mbstring php53-devel php53-common php53-cli php53-xml  php53-sqlite2 php53-pdo php53-gd

php53-mysql拿出來處理,因為會有衝突發生

 file /usr/share/mysql/ukrainian/errmsg.sys from install of mysql-libs-5.1.57-1.el5.art.i386 conflicts with file from package mysql-5.0.77-4.el5_6.6.i386

我的mysql-server是5.0.77,我把它升級到 5.1.57 (yum update mysql-server)

再來yum install php53-mysql 就ok了

php -v

PHP 5.3.6 (cli) (built: Apr 19 2011 12:28:40)
Copyright (c) 1997-2011 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2011 Zend Technologies

問題1: php -i 時有錯誤 ?

PHP Warning:  Unknown: It is not safe to rely on the system’s timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected ‘Asia/Chongqing’ for ‘CST/8.0/no DST’ instead in Unknown on line 0

解決方式:
編輯/etc/php.ini,找到 [Date]區塊,加入 date.timezone = “Asia/Taipei”

問題2: phpinfo無法顯示內容 ?

解決方式:

一定要有 <?php 而不能再只是 <?

<?php
phpinfo();
?>

 

Related posts 相關文章
升級 AlmaLinux 8.4 到 AlmaLinux 8.5
More...
架設 GitLab 作 Git 版本控管(九) – 更新
More...
Fedora 將預設用 DNF 取代 YUM 作套件安裝管理
More...
升級 icinga 遇到的問題,從 1.11.x 版到 1.13.x
More...

作者

留言

先把舊的 php 移掉 yum erase php*

撰寫回覆或留言

發佈留言必須填寫的電子郵件地址不會公開。