CentOS 5에 PHP 5.3 설치 (yum)

(CentOS 5에 PHP 5.2 설치 (yum)에서 넘어옴)
  다른 뜻에 대해서는 CentOS 6에 PHP 5.3 설치 (yum) 문서를 참조하십시오.

1 개요[ | ]

PHP 5.3 업그레이드
CentOS 5에 PHP 5.3 설치
  • (방법1) CentOS 5 기본 저장소(base)에서 PHP 5.3.3을 설치
  • (방법2) webtatic 저장소를 이용하여 PHP 5.3.27을 설치(이쪽이 상위버전)

2 사전 확인[ | ]

[root@zetawiki ~]# php -v | head -1
PHP 5.1.6 (cli) (built: Jun 27 2012 12:21:13)
→ PHP 버전은 5.1.6이다.
[root@zetawiki ~]# yum repolist
... (생략)
repo id                repo name                         status
addons                 CentOS-5 - Addons                       0
base                   CentOS-5 - Base                   3,654+8
extras                 CentOS-5 - Extras                     265
updates                CentOS-5 - Updates                 477+40
repolist: 4,396
→ CentOS 5 기본 저장소 사용중
[root@zetawiki ~]# yum list php
... (생략)
Installed Packages
php.x86_64               5.1.6-44.el5_10               installed
→ 5.1.6이 설치되어 있으며 다른 Available한 다른 버전은 보이지 않는다.

3 방법 1: 5.3.3 설치 (base)[ | ]

php53이라는 패키지명으로 들어 있다.

[root@zetawiki ~]# yum install php53
... (생략)
php53-common-5.3.3-21.el5.x86_64 from base 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
The program package-cleanup is found in the yum-utils package.
→ 그런데 설치하려고 하면 기존 php-common과 충돌 있음

3.1 기설치된 php 패키지 확인[ | ]

[root@zetawiki ~]# yum list installed php*
... (생략)
Installed Packages
php.x86_64                           5.1.6-44.el5_10   installed
php-cli.x86_64                       5.1.6-44.el5_10   installed
php-common.x86_64                    5.1.6-44.el5_10   installed
php-devel.x86_64                     5.1.6-44.el5_10   installed
php-gd.x86_64                        5.1.6-44.el5_10   installed
php-mysql.x86_64                     5.1.6-44.el5_10   installed
php-pdo.x86_64                       5.1.6-44.el5_10   installed
php-zend-optimizer.x86_64            1:3.3.0-0         installed
php-zend-optimizer-debuginfo.x86_64  1:3.3.0-0         installed

3.2 기설치된 php 패키지 삭제[ | ]

  • php-common을 삭제하면 의존성 있는 관련 패키지들을 함께 삭제할 수 있다.
(php-zend-optimizer-debuginfo는 나오지 않아서 따로 추가하였다.)
[root@zetawiki ~]# yum remove php-common php-zend-optimizer-debuginfo
... (생략)
================================================================
 Package             Arch    Version           Repository  Size
================================================================
Removing:
 php-common          x86_64  5.1.6-44.el5_10   installed  397 k
 php-zend-optimizer-debuginfo
                     x86_64  1:3.3.0-0         installed   0.0 
Removing for dependencies:
 php                 x86_64  5.1.6-44.el5_10   installed  6.3 M
 php-cli             x86_64  5.1.6-44.el5_10   installed  5.3 M
 php-devel           x86_64  5.1.6-44.el5_10   installed  2.5 M
 php-gd              x86_64  5.1.6-44.el5_10   installed  333 k
 php-mysql           x86_64  5.1.6-44.el5_10   installed  196 k
 php-pdo             x86_64  5.1.6-44.el5_10   installed  114 k
 php-zend-optimizer  x86_64  1:3.3.0-0         installed   13 M

Transaction Summary
================================================================
Remove        9 Package(s)
Reinstall     0 Package(s)
Downgrade     0 Package(s)

Is this ok [y/N]: y
... (생략)
Removed:
  php-common.x86_64 0:5.1.6-44.el5_10                           
  php-zend-optimizer-debuginfo.x86_64 1:3.3.0-0                 

Dependency Removed:
  php.x86_64 0:5.1.6-44.el5_10                                  
  php-cli.x86_64 0:5.1.6-44.el5_10                              
  php-devel.x86_64 0:5.1.6-44.el5_10                            
  php-gd.x86_64 0:5.1.6-44.el5_10                               
  php-mysql.x86_64 0:5.1.6-44.el5_10                            
  php-pdo.x86_64 0:5.1.6-44.el5_10                              
  php-zend-optimizer.x86_64 1:3.3.0-0                           

Complete!

3.3 php53 설치[ | ]

[root@zetawiki ~]# yum install php53-devel php53-gd php53-mysql
... (생략)
================================================================
 Package         Arch      Version             Repository  Size
================================================================
Installing:
 php53-devel     x86_64    5.3.3-22.el5_10     updates    593 k
 php53-gd        x86_64    5.3.3-22.el5_10     updates    112 k
 php53-mysql     x86_64    5.3.3-22.el5_10     updates     95 k
Installing for dependencies:
 libXpm          x86_64    3.5.5-3             base        44 k
 php53           x86_64    5.3.3-22.el5_10     updates    1.3 M
 php53-cli       x86_64    5.3.3-22.el5_10     updates    2.4 M
 php53-common    x86_64    5.3.3-22.el5_10     updates    608 k
 php53-pdo       x86_64    5.3.3-22.el5_10     updates     70 k

Transaction Summary
================================================================
Install       8 Package(s)
Upgrade       0 Package(s)

Total download size: 5.2 M
Is this ok [y/N]: y
... (생략)
Installed:
  php53-devel.x86_64 0:5.3.3-22.el5_10                          
  php53-gd.x86_64 0:5.3.3-22.el5_10                             
  php53-mysql.x86_64 0:5.3.3-22.el5_10                          

Dependency Installed:
  libXpm.x86_64 0:3.5.5-3                                       
  php53.x86_64 0:5.3.3-22.el5_10                                
  php53-cli.x86_64 0:5.3.3-22.el5_10                            
  php53-common.x86_64 0:5.3.3-22.el5_10                         
  php53-pdo.x86_64 0:5.3.3-22.el5_10                            

Complete!

3.4 확인[ | ]

[root@zetawiki ~]# php -v
PHP 5.3.3 (cli) (built: Dec 10 2013 22:12:52) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

4 방법 2: 5.3.27 설치 (webtatic)[ | ]

4.1 webtatic 저장소 추가[ | ]

4.2 설치[ | ]

[root@zetawiki ~]# yum --enablerepo=webtatic install php
... (생략)
======================================================================================================
 Package                  Arch                 Version                   Repository              Size
======================================================================================================
Updating:
 php                      x86_64               5.3.27-2.w5               webtatic               1.4 M
Updating for dependencies:
 php-cli                  x86_64               5.3.27-2.w5               webtatic               2.6 M
 php-common               x86_64               5.3.27-2.w5               webtatic               664 k

Transaction Summary
======================================================================================================
Install       0 Package(s)
Upgrade       3 Package(s)

Total download size: 4.6 M
Is this ok [y/N]: y
... (생략)
Updated:
  php.x86_64 0:5.3.27-2.w5                                                                            

Dependency Updated:
  php-cli.x86_64 0:5.3.27-2.w5                     php-common.x86_64 0:5.3.27-2.w5                    

Complete!

4.3 확인[ | ]

[root@zetawiki ~]# php -v
PHP 5.3.27 (cli) (built: Jul 13 2013 22:31:41) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies

5 같이 보기[ | ]

6 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}